Revert "clean up List db queries"
This reverts commit 41f27a4a66
.
I forgot that update() can only be done on a query result, not on an object, so we will need to go back to querying in order to update rather than saving.
This commit is contained in:
parent
1634c8774e
commit
2f38af4faa
2 changed files with 8 additions and 3 deletions
|
@ -58,7 +58,7 @@ class Lists(View):
|
|||
book_list = form.save()
|
||||
# list should not have a group if it is not group curated
|
||||
if not book_list.curation == "group":
|
||||
book_list.update(group=None)
|
||||
models.List.objects.filter(id=book_list.id).update(group=None)
|
||||
|
||||
return redirect(book_list.local_path)
|
||||
|
||||
|
@ -193,7 +193,7 @@ class List(View):
|
|||
return redirect("list", book_list.id)
|
||||
book_list = form.save()
|
||||
if not book_list.curation == "group":
|
||||
book_list.update(group=None)
|
||||
models.List.objects.filter(id=book_list.id).update(group=None)
|
||||
return redirect(book_list.local_path)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue