Made format_undertitle() Jinja filter None-safe
This commit is contained in:
parent
7f9f89853d
commit
cd8707207b
@ -22,6 +22,10 @@ def format_undertitle(s):
|
||||
Replaces underscores with spaces, and then applies Jinja2's own title filter.
|
||||
"""
|
||||
|
||||
# Just keep empty strings and Nones as they are.
|
||||
if not s:
|
||||
return s
|
||||
|
||||
return jinja2.filters.do_title(s.replace('_', ' '))
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user