Skip to content

Commit

Permalink
Raise a ValueError in localtime filter if no datetime
Browse files Browse the repository at this point in the history
  • Loading branch information
davegaeddert committed Jan 23, 2024
1 parent dc260ad commit 2442976
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bolt/templates/jinja/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def localtime_filter(value, timezone=None):
if not value:
# Without this, we get the current localtime
# which doesn't make sense as a filter
return None
raise ValueError("localtime filter requires a datetime")
return localtime(value, timezone)


Expand Down

0 comments on commit 2442976

Please sign in to comment.