Fixes error in cover alt text templateteag

This commit is contained in:
Mouse Reeve 2020-05-10 18:22:34 -07:00
parent d8aadb4587
commit 29477c24f4

View file

@ -121,8 +121,10 @@ def get_boosted(boost):
@register.filter(name='edition_info') @register.filter(name='edition_info')
def get_edition_info(book): def get_edition_info(book):
''' paperback, French language, 1982 ''' ''' paperback, French language, 1982 '''
if not book:
return
items = [ items = [
book.physical_format, book.physical_format if isinstance(book, models.Edition) else None,
book.languages[0] + ' language' if book.languages and \ book.languages[0] + ' language' if book.languages and \
book.languages[0] != 'English' else None, book.languages[0] != 'English' else None,
str(book.published_date.year) if book.published_date else None, str(book.published_date.year) if book.published_date else None,