Skip to content

Commit

Permalink
Checks permissions when saving a list
Browse files Browse the repository at this point in the history
  • Loading branch information
mouse-reeve committed Jul 28, 2022
1 parent 85dce81 commit 2837d01
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bookwyrm/views/list/lists.py
Expand Up @@ -36,11 +36,13 @@ def post(self, request):
form = forms.ListForm(request.POST)
if not form.is_valid():
return redirect("lists")
book_list = form.save()
book_list = form.save(commit=False)
book_list.raise_not_editable(request.user)

# list should not have a group if it is not group curated
if not book_list.curation == "group":
book_list.group = None
book_list.save(broadcast=False)
book_list.save()

return redirect(book_list.local_path)

Expand Down

0 comments on commit 2837d01

Please sign in to comment.