diff --git a/openedx/core/djangoapps/content/search/handlers.py b/openedx/core/djangoapps/content/search/handlers.py index fb3f9181a580..1605f8ebfd58 100644 --- a/openedx/core/djangoapps/content/search/handlers.py +++ b/openedx/core/djangoapps/content/search/handlers.py @@ -195,9 +195,10 @@ def content_object_associations_changed_handler(**kwargs) -> None: try: # Check if valid if course or library block - usage_key = UsageKey.from_string(str(content_object.object_id)) + usage_key = UsageKey.from_string(str(content_object.object_id)) except InvalidKeyError: try: + # Check if valid if library collection usage_key = LibraryCollectionLocator.from_string(str(content_object.object_id)) except InvalidKeyError: log.error("Received invalid content object id")