We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 55ca4c7 commit 2b353cbCopy full SHA for 2b353cb
exec/publicity.py
@@ -520,7 +520,10 @@ def create_single_week( # noqa: PLR0912, PLR0915
520
521
# get the events for the week
522
# find the list of weeks in the term
523
- term_weeks = events[0]["terms"][0]["weeks"]
+ try:
524
+ term_weeks = events[0]["terms"][0]["weeks"]
525
+ except (IndexError, KeyError):
526
+ raise ValueError("No events found for this week") from None
527
# because terms can start at negative weeks, have gaps, and use different indexing
528
# loop over the weeks to find the correct one
529
week_days = []
0 commit comments