mirror of
https://github.com/inventree/InvenTree.git
synced 2026-10-04 17:35:21 +00:00
Prevent operations on null dates
This commit is contained in:
1 parent
7d19b21dff
commit
0eba6f2476
1 file changed
+3
@@ -53,6 +53,9 @@ def render_date(context, date_object):
|
||||
which differs from the python formatting!
|
||||
"""
|
||||
|
||||
if date_object is None:
|
||||
return None
|
||||
|
||||
if type(date_object) == str:
|
||||
# If a string is passed, first convert it to a datetime
|
||||
date_object = date.fromisoformat(date_object)
|
||||
|
||||
Reference in new issue
Block a user