Skip to content

Commit 2b353cb

Browse files
committed
corrected issue with deleted weeks
1 parent 55ca4c7 commit 2b353cb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

exec/publicity.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,10 @@ def create_single_week( # noqa: PLR0912, PLR0915
520520

521521
# get the events for the week
522522
# find the list of weeks in the term
523-
term_weeks = events[0]["terms"][0]["weeks"]
523+
try:
524+
term_weeks = events[0]["terms"][0]["weeks"]
525+
except (IndexError, KeyError):
526+
raise ValueError("No events found for this week") from None
524527
# because terms can start at negative weeks, have gaps, and use different indexing
525528
# loop over the weeks to find the correct one
526529
week_days = []

0 commit comments

Comments
 (0)