mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Prevent operations on null dates
This commit is contained in:
parent
7d19b21dff
commit
0eba6f2476
@ -53,6 +53,9 @@ def render_date(context, date_object):
|
|||||||
which differs from the python formatting!
|
which differs from the python formatting!
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
if date_object is None:
|
||||||
|
return None
|
||||||
|
|
||||||
if type(date_object) == str:
|
if type(date_object) == str:
|
||||||
# If a string is passed, first convert it to a datetime
|
# If a string is passed, first convert it to a datetime
|
||||||
date_object = date.fromisoformat(date_object)
|
date_object = date.fromisoformat(date_object)
|
||||||
|
Loading…
Reference in New Issue
Block a user