Skip to content

Commit

Permalink
fixup! Short-circuit before reparsing datetimes
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtylerwalls committed Jan 7, 2025
1 parent a79b25e commit 796cc86
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions arches/app/datatypes/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,10 +751,11 @@ def transform_value_for_tile(self, value, **kwargs):
else:
v = datetime.strptime(value, settings.DATE_IMPORT_EXPORT_FORMAT)
# The .astimezone() function throws an error on Windows for dates before 1970
try:
v = v.astimezone()
except:
v = self.backup_astimezone(v)
if isinstance(v, datetime):
try:
v = v.astimezone()
except:
v = self.backup_astimezone(v)
value = v.isoformat(timespec="milliseconds")
return value

Expand Down

0 comments on commit 796cc86

Please sign in to comment.