diff --git a/platform_plugin_aspects/signals.py b/platform_plugin_aspects/signals.py index fc630f8..f03ec07 100644 --- a/platform_plugin_aspects/signals.py +++ b/platform_plugin_aspects/signals.py @@ -5,6 +5,7 @@ from django.db import transaction from django.db.models.signals import post_delete, post_save from django.dispatch import Signal, receiver +from opaque_keys import InvalidKeyError from platform_plugin_aspects.sinks import ( CourseEnrollmentSink, @@ -235,7 +236,7 @@ def on_object_tag_deleted( # pylint: disable=unused-argument # pragma: no cove try: CourseOverview.objects.get(id=instance.object_id) dump_course_to_clickhouse.delay(instance.object_id) - except CourseOverview.DoesNotExist: + except (CourseOverview.DoesNotExist, InvalidKeyError): pass