mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-26 01:50:34 +00:00
active_shelf should always be a reading status shelf
This commit is contained in:
parent
a082121930
commit
373cc2c762
1 changed files with 2 additions and 1 deletions
|
@ -77,7 +77,8 @@ def related_status(notification):
|
|||
def active_shelf(context, book):
|
||||
"""check what shelf a user has a book on, if any"""
|
||||
if hasattr(book, "current_shelves"):
|
||||
return book.current_shelves[0] if len(book.current_shelves) else {"book": book}
|
||||
read_shelves = [s for s in book.current_shelves if s.shelf.identifier in models.Shelf.READ_STATUS_IDENTIFIERS]
|
||||
return read_shelves[0] if len(read_shelves) else {"book": book}
|
||||
|
||||
shelf = (
|
||||
models.ShelfBook.objects.filter(
|
||||
|
|
Loading…
Reference in a new issue