Be consistent between variable name & logic. Equal is already too short.

This commit is contained in:
Fabien Basmaison 2021-06-09 19:03:15 +02:00
parent c4072cbc04
commit 6be97a6102

View file

@ -21,12 +21,12 @@ def get_user_identifier(user):
@register.filter(name="book_title") @register.filter(name="book_title")
def get_title(book, too_short=6): def get_title(book, too_short=5):
"""display the subtitle if the title is short""" """display the subtitle if the title is short"""
if not book: if not book:
return "" return ""
title = book.title title = book.title
if len(title) < too_short and book.subtitle: if len(title) <= too_short and book.subtitle:
title = _("%(title)s: %(subtitle)s") % { title = _("%(title)s: %(subtitle)s") % {
"title": title, "title": title,
"subtitle": book.subtitle, "subtitle": book.subtitle,