55
66from edx_django_utils .cache import RequestCache
77from opaque_keys import InvalidKeyError
8- from opaque_keys .edx .keys import CourseKey , UsageKey , LibraryCollectionKey
8+ from opaque_keys .edx .keys import CourseKey , UsageKey , LibraryElementKey
99from opaque_keys .edx .locator import LibraryLocatorV2
1010from openedx_tagging .core .tagging .models import Taxonomy
1111from organizations .models import Organization
@@ -28,11 +28,11 @@ def get_content_key_from_string(key_str: str) -> ContentKey:
2828 return UsageKey .from_string (key_str )
2929 except InvalidKeyError :
3030 try :
31- return LibraryCollectionKey .from_string (key_str )
31+ return LibraryElementKey .from_string (key_str )
3232 except InvalidKeyError as usage_key_error :
3333 raise ValueError (
3434 "object_id must be one of the following "
35- "keys: CourseKey, LibraryLocatorV2, UsageKey or LibCollectionKey "
35+ "keys: CourseKey, LibraryLocatorV2, UsageKey or LibraryElementKey "
3636 ) from usage_key_error
3737
3838
@@ -44,8 +44,8 @@ def get_context_key_from_key(content_key: ContentKey) -> ContextKey:
4444 if isinstance (content_key , (CourseKey , LibraryLocatorV2 )):
4545 return content_key
4646
47- # If the content key is a LibraryCollectionKey , return the LibraryLocatorV2
48- if isinstance (content_key , LibraryCollectionKey ):
47+ # If the content key is a LibraryElementKey , return the LibraryLocatorV2
48+ if isinstance (content_key , LibraryElementKey ):
4949 return content_key .library_key
5050
5151 # If the content key is a UsageKey, return the context key
0 commit comments