diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 381c185f..a786a1b6 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -13,6 +13,14 @@ Change Log Unreleased ~~~~~~~~~~ +[7.0.1] + +* Do not send events for unknown courses + +[7.0.0] + +* Multi-question problem_check tracking log statements will now be split into one xAPI statement for each question + [6.2.0] * Add support for completion events diff --git a/event_routing_backends/__init__.py b/event_routing_backends/__init__.py index abb7ae37..8bbadc57 100644 --- a/event_routing_backends/__init__.py +++ b/event_routing_backends/__init__.py @@ -2,4 +2,4 @@ Various backends for receiving edX LMS events.. """ -__version__ = '7.0.0' +__version__ = '7.0.1' diff --git a/event_routing_backends/helpers.py b/event_routing_backends/helpers.py index dc21f679..bfa21d57 100644 --- a/event_routing_backends/helpers.py +++ b/event_routing_backends/helpers.py @@ -149,9 +149,7 @@ 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", - } + raise ValueError(f"Course with id {course_id} does not exist.") def convert_seconds_to_iso(seconds): diff --git a/event_routing_backends/tests/test_helpers.py b/event_routing_backends/tests/test_helpers.py index d2d2f06b..48b90a0e 100644 --- a/event_routing_backends/tests/test_helpers.py +++ b/event_routing_backends/tests/test_helpers.py @@ -79,7 +79,7 @@ def test_get_uuid5(self): self.assertNotEqual(uuid_1, uuid_3) @patch('event_routing_backends.helpers.get_course_overviews') - def test_get_course_from_id(self, mock_get_course_overviews): + def test_get_course_from_id_unknown_course(self, mock_get_course_overviews): mock_get_course_overviews.return_value = [] - course = get_course_from_id("foo") - self.assertEqual(course["display_name"], "Unknown Course") + with self.assertRaises(ValueError): + get_course_from_id("foo")