mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-23 08:36:32 +00:00
Python formatting
This commit is contained in:
parent
02dd1e9443
commit
a09c813f73
1 changed files with 6 additions and 3 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue