From 0eba6f24767629de663d572d1c8ab12c3476e4b8 Mon Sep 17 00:00:00 2001 From: Oliver Date: Mon, 28 Feb 2022 23:39:11 +1100 Subject: [PATCH] Prevent operations on null dates --- InvenTree/part/templatetags/inventree_extras.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/InvenTree/part/templatetags/inventree_extras.py b/InvenTree/part/templatetags/inventree_extras.py index 8aedf583de..7f0d7ff3cc 100644 --- a/InvenTree/part/templatetags/inventree_extras.py +++ b/InvenTree/part/templatetags/inventree_extras.py @@ -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)