From 373cc2c762060b93b1edbeec04528d5632f4f65b Mon Sep 17 00:00:00 2001 From: Hugh Rundle Date: Sat, 20 Nov 2021 09:58:34 +1100 Subject: [PATCH] active_shelf should always be a reading status shelf --- bookwyrm/templatetags/bookwyrm_tags.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bookwyrm/templatetags/bookwyrm_tags.py b/bookwyrm/templatetags/bookwyrm_tags.py index bccd8c75a..425ecc158 100644 --- a/bookwyrm/templatetags/bookwyrm_tags.py +++ b/bookwyrm/templatetags/bookwyrm_tags.py @@ -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(