Skip to content

Commit

Permalink
Merge pull request #1473 from coronasafe/sainak/hotfix/discharge-summary
Browse files Browse the repository at this point in the history
handle exception in template date parsing
  • Loading branch information
mathew-alex authored Jul 25, 2023
2 parents 8f307f5 + d4dcbce commit 025505f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion care/facility/templatetags/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,7 @@ def field_name_to_label(value):

@register.filter(expects_localtime=True)
def parse_datetime(value):
return datetime.strptime(value, "%Y-%m-%dT%H:%M")
try:
return datetime.strptime(value, "%Y-%m-%dT%H:%M")
except ValueError:
return None

0 comments on commit 025505f

Please sign in to comment.