mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-26 11:31:08 +00:00
Safely handle invalid book
This commit is contained in:
parent
a499259163
commit
179ba24115
1 changed files with 2 additions and 0 deletions
|
@ -171,6 +171,8 @@ def get_next_shelf(current_shelf):
|
|||
@register.filter(name="title")
|
||||
def get_title(book):
|
||||
""" display the subtitle if the title is short """
|
||||
if not book:
|
||||
return ""
|
||||
title = book.title
|
||||
if len(title) < 6 and book.subtitle:
|
||||
title = "{:s}: {:s}".format(title, book.subtitle)
|
||||
|
|
Loading…
Reference in a new issue