Python formatting

This commit is contained in:
Mouse Reeve 2022-02-04 19:44:03 -08:00
parent 49ceb2a978
commit a73960a0da

View file

@ -26,9 +26,11 @@ class Author(View):
if is_api_request(request): if is_api_request(request):
return ActivitypubResponse(author.to_activity()) return ActivitypubResponse(author.to_activity())
books = models.Work.objects.filter( books = (
Q(authors=author) | Q(editions__authors=author) models.Work.objects.filter(Q(authors=author) | Q(editions__authors=author))
).order_by("-published_date").distinct() .order_by("-published_date")
.distinct()
)
paginated = Paginator(books, PAGE_LENGTH) paginated = Paginator(books, PAGE_LENGTH)
page = paginated.get_page(request.GET.get("page")) page = paginated.get_page(request.GET.get("page"))