Python formatting

This commit is contained in:
Mouse Reeve 2022-01-17 19:04:20 -08:00
parent 02dd1e9443
commit a09c813f73

View file

@ -17,7 +17,8 @@ def get_rating(book, user):
f"book-rating-{book.parent_work.id}-{user.id}",
lambda u, b: models.Review.privacy_filter(u)
.filter(book__parent_work__editions=b)
.aggregate(Avg("rating"))["rating__avg"] or 0,
.aggregate(Avg("rating"))["rating__avg"]
or 0,
user,
book,
timeout=15552000,
@ -144,7 +145,8 @@ def active_shelf(context, book):
models.ShelfBook.objects.filter(
shelf__user=u,
book__parent_work__editions=b,
).first() or False
).first()
or False
),
user,
book,
@ -162,7 +164,8 @@ def latest_read_through(book, user):
lambda u, b: (
models.ReadThrough.objects.filter(user=u, book=b, is_active=True)
.order_by("-start_date")
.first() or False
.first()
or False
),
user,
book,