mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-28 04:21:07 +00:00
code cleanup in is_shelf_type template tag
This commit is contained in:
parent
168a2488e2
commit
eab2ec0ffd
1 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue