Skip to content

Commit 796cc86

Browse files
fixup! Short-circuit before reparsing datetimes
1 parent a79b25e commit 796cc86

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

arches/app/datatypes/datatypes.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -751,10 +751,11 @@ def transform_value_for_tile(self, value, **kwargs):
751751
else:
752752
v = datetime.strptime(value, settings.DATE_IMPORT_EXPORT_FORMAT)
753753
# The .astimezone() function throws an error on Windows for dates before 1970
754-
try:
755-
v = v.astimezone()
756-
except:
757-
v = self.backup_astimezone(v)
754+
if isinstance(v, datetime):
755+
try:
756+
v = v.astimezone()
757+
except:
758+
v = self.backup_astimezone(v)
758759
value = v.isoformat(timespec="milliseconds")
759760
return value
760761

0 commit comments

Comments
 (0)