Skip to content

Commit 2442976

Browse files
committed
Raise a ValueError in localtime filter if no datetime
1 parent dc260ad commit 2442976

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bolt/templates/jinja/filters.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def localtime_filter(value, timezone=None):
1111
if not value:
1212
# Without this, we get the current localtime
1313
# which doesn't make sense as a filter
14-
return None
14+
raise ValueError("localtime filter requires a datetime")
1515
return localtime(value, timezone)
1616

1717

0 commit comments

Comments
 (0)