Skip to content

Commit

Permalink
Even more defensiveness in datetime parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
aothms committed Nov 11, 2024
1 parent 09b5816 commit dff17f9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion backend/apps/ifc_validation/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,10 @@ def parse_info_subtask(self, prev_result, id, file_name, *args, **kwargs):
tzinfo=datetime.timezone.utc)
model.date = date_with_tz
except ValueError:
model.date = datetime.datetime.fromisoformat(ifc_file_time_stamp)
try:
model.date = datetime.datetime.fromisoformat(ifc_file_time_stamp)
except ValueError:
pass
logger.debug(f'Detected date = {model.date}')

# MVD
Expand Down

0 comments on commit dff17f9

Please sign in to comment.