Test for deleting authors

This commit is contained in:
Mouse Reeve
2021-03-07 15:14:57 -08:00
parent 79d9c493f7
commit 1eac2b9386
2 changed files with 23 additions and 1 deletions

View File

@ -206,6 +206,10 @@ class ConfirmEditBook(View):
name=request.POST.get('add_author'))
book.authors.add(author)
remove_authors = request.POST.getlist('remove_authors')
for author_id in remove_authors:
book.authors.remove(author_id)
return redirect('/book/%s' % book.id)