chore: formatting

This commit is contained in:
Dustin Steiner 2023-01-30 14:45:30 +00:00
parent 59a8098517
commit e0505722e1
No known key found for this signature in database
GPG key ID: 918D51522D8CB8F2

View file

@ -31,7 +31,9 @@ class BookSeriesBy(View):
unsortable_books = [] unsortable_books = []
for work_id in set(work_ids): for work_id in set(work_ids):
result = ( result = (
results.filter(parent_work=work_id).order_by("series_number", "-edition_rank").first() results.filter(parent_work=work_id)
.order_by("series_number", "-edition_rank")
.first()
) )
if result.series_number: if result.series_number:
numbered_books.append(result) numbered_books.append(result)
@ -48,7 +50,10 @@ class BookSeriesBy(View):
if book.first_published_date if book.first_published_date
else book.published_date, else book.published_date,
) )
+ sorted(unsortable_books, key=lambda book: book.sort_title if book.sort_title else book.title) + sorted(
unsortable_books,
key=lambda book: book.sort_title if book.sort_title else book.title,
)
) )
data = { data = {