Skip to content

Commit

Permalink
refactor¡: send event for missing courses configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian2012 committed Oct 3, 2023
1 parent 99ede4e commit 057ae74
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions event_routing_backends/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,13 @@ def get_course_from_id(course_id):
course_overviews = get_course_overviews([course_key])
if course_overviews:
return course_overviews[0]
return {
"display_name": "Unknown Course",
}
SEND_MISSING_COURSES = getattr(settings, 'EVENT_ROUTING_BACKENDS_SEND_MISSING_COURSES', False)
if SEND_MISSING_COURSES:
return {
"display_name": "Unknown Course",
}
raise ValueError(f"Course with id {course_id} does not exist.")



def convert_seconds_to_iso(seconds):
Expand Down

0 comments on commit 057ae74

Please sign in to comment.