From c520fe8f1985766a210b5f4e8d4a611c35f88397 Mon Sep 17 00:00:00 2001 From: Michael Terry Date: Tue, 9 Jun 2020 11:05:02 -0400 Subject: [PATCH] PROD-1633: fix highlights error case When calculating course highlights, if we didn't manage to get a course module, we were previously throwing an exception. Handle that more gracefully. --- openedx/core/djangoapps/schedules/content_highlights.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openedx/core/djangoapps/schedules/content_highlights.py b/openedx/core/djangoapps/schedules/content_highlights.py index e0ea6f5b16..3c4148f30f 100644 --- a/openedx/core/djangoapps/schedules/content_highlights.py +++ b/openedx/core/djangoapps/schedules/content_highlights.py @@ -134,7 +134,10 @@ def _section_has_highlights(section): def _get_sections_with_highlights(course_module): - return list(filter(_section_has_highlights, course_module.get_children())) + if course_module: + return list(filter(_section_has_highlights, course_module.get_children())) + else: + return [] def _get_highlights_for_week(sections, week_num, course_key):