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.
This commit is contained in:
Michael Terry
2020-06-09 11:05:02 -04:00
parent 8d4e71957c
commit c520fe8f19

View File

@@ -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):