Skip to content

Commit

Permalink
fix: handle uncaught expection while processing Enkora event timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
hel-andreasg committed Jun 25, 2024
1 parent bb4328d commit 430522b
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions events/importer/enkora.py
Original file line number Diff line number Diff line change
Expand Up @@ -1585,9 +1585,20 @@ def _handle_course(self, course: dict) -> tuple[dict, list[dict]]:
if field_name not in course:
dates[field_name] = None
else:
dates[field_name] = timezone.make_aware(
course[field_name], EnkoraImporter.EEST
)
try:
dates[field_name] = timezone.make_aware(
course[field_name], EnkoraImporter.EEST
)
except AttributeError:
logging.error(
(
"Enkora event ID {}: unable to add timezone info for field name {}"
", skipping event and related sub-events"
).format(
course["reservation_event_group_id"],
field_name,
)
)

# Course capacity:
if (
Expand Down

0 comments on commit 430522b

Please sign in to comment.