String Check, replace Nonetype with empty string

This commit is contained in:
Tom Weber 2021-02-24 08:20:27 -07:00
parent 1271f00278
commit 9e3466a069

View File

@ -30,5 +30,6 @@ def datetime_string_format(value):
try:
new_value = date_filter(datetime.strptime(value, CUSTOMFIELD_TIME_FORMAT), settings.TIME_FORMAT)
except (TypeError, ValueError):
new_value = value
# If NoneType return empty string, else return original value
new_value = "" if value is None else value
return new_value