mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Check for empty string when rendering dates
This commit is contained in:
parent
d02fc61a8f
commit
b720c2e431
@ -57,6 +57,13 @@ def render_date(context, date_object):
|
||||
return None
|
||||
|
||||
if type(date_object) == str:
|
||||
|
||||
date_object = date_object.strip()
|
||||
|
||||
# Check for empty string
|
||||
if len(date_object) == 0:
|
||||
return None
|
||||
|
||||
# If a string is passed, first convert it to a datetime
|
||||
date_object = date.fromisoformat(date_object)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user