From eab2ec0ffd0a2734bd6732386f524c59ad21bcc2 Mon Sep 17 00:00:00 2001 From: Hugh Rundle Date: Mon, 15 Nov 2021 21:19:16 +1100 Subject: [PATCH] code cleanup in is_shelf_type template tag --- bookwyrm/templatetags/bookwyrm_tags.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bookwyrm/templatetags/bookwyrm_tags.py b/bookwyrm/templatetags/bookwyrm_tags.py index 992f584a..c7ecbe4d 100644 --- a/bookwyrm/templatetags/bookwyrm_tags.py +++ b/bookwyrm/templatetags/bookwyrm_tags.py @@ -42,12 +42,12 @@ def get_book_description(book): @register.filter(name="is_shelf_type") -def shelf_type(current_shelf, shelf_type): +def is_shelf_type(current_shelf, shelf_type): """is this shelf a readthrough shelf?""" readthrough = current_shelf in ["to-read", "reading", "read"] - if shelf_type == "readthrough" and readthrough == True: + if shelf_type == "readthrough" and bool(readthrough): return True - if shelf_type == "custom" and readthrough == False: + if shelf_type == "custom" and not readthrough: return True return False