Tests create books flow
This commit is contained in:
parent
acbebbe947
commit
58b48faff8
2 changed files with 30 additions and 2 deletions
|
@ -1,5 +1,4 @@
|
|||
""" the good stuff! the books! """
|
||||
from django.core.paginator import Paginator
|
||||
from django.contrib.auth.decorators import login_required, permission_required
|
||||
from django.contrib.postgres.search import SearchRank, SearchVector
|
||||
from django.core.paginator import Paginator
|
||||
|
@ -207,7 +206,7 @@ class ConfirmEditBook(View):
|
|||
if work_match:
|
||||
work = get_object_or_404(models.Work, id=work_match)
|
||||
else:
|
||||
work = models.Work.objects.create(title=form.cleaned_data.title)
|
||||
work = models.Work.objects.create(title=form.cleaned_data["title"])
|
||||
work.authors.set(book.authors.all())
|
||||
book.parent_work = work
|
||||
book.save()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue