Adds tests and fixes unset ordering warnings

This commit is contained in:
Mouse Reeve
2021-10-20 18:27:19 -07:00
parent d706b26ac9
commit 72dc21e82a
2 changed files with 28 additions and 3 deletions

View File

@ -33,7 +33,9 @@ class Author(View):
.filter(Q(authors=author) | Q(parent_work__authors=author))
.annotate(default_id=Subquery(default_editions.values("id")[:1]))
.filter(default_id=F("id"))
).prefetch_related("authors")
.order_by("-first_published_date", "-published_date", "-created_date")
.prefetch_related("authors")
)
paginated = Paginator(books, PAGE_LENGTH)
page = paginated.get_page(request.GET.get("page"))