mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-30 20:46:47 +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…
x
Reference in New Issue
Block a user