Fixes add/edit notes form on list page

This commit is contained in:
Mouse Reeve 2022-02-03 10:30:30 -08:00
parent baf28c523a
commit a46ab96d9b
2 changed files with 4 additions and 2 deletions

View file

@ -97,7 +97,7 @@
<span class="details-close icon icon-pencil" aria-hidden></span> <span class="details-close icon icon-pencil" aria-hidden></span>
</span> </span>
</summary> </summary>
{% include "lists/edit_item_form.html" %} {% include "lists/edit_item_form.html" with book=item.book %}
</details> </details>
</div> </div>
{% endif %} {% endif %}
@ -112,7 +112,7 @@
<span class="details-close icon icon-plus" aria-hidden></span> <span class="details-close icon icon-plus" aria-hidden></span>
</span> </span>
</summary> </summary>
{% include "lists/edit_item_form.html" %} {% include "lists/edit_item_form.html" with book=item.book %}
</details> </details>
</div> </div>
{% endif %} {% endif %}

View file

@ -19,4 +19,6 @@ class ListItem(View):
form = forms.ListItemForm(request.POST, instance=list_item) form = forms.ListItemForm(request.POST, instance=list_item)
if form.is_valid(): if form.is_valid():
form.save() form.save()
else:
raise Exception(form.errors)
return redirect("list", list_item.book_list.id) return redirect("list", list_item.book_list.id)