1111from opaque_keys .edx .keys import CourseKey
1212from opaque_keys .edx .locator import LibraryLocatorV2
1313
14- from openedx_authz .api .data import GLOBAL_SCOPE_WILDCARD , ScopeData
1514from openedx_authz .models .core import Scope
1615
1716
@@ -82,7 +81,7 @@ class ContentLibraryScope(Scope):
8281 )
8382
8483 @classmethod
85- def get_or_create_for_external_key (cls , scope : ScopeData ) -> "ContentLibraryScope" :
84+ def get_or_create_for_external_key (cls , scope ) -> "ContentLibraryScope" :
8685 """Get or create a ContentLibraryScope for the given external key.
8786
8887 Args:
@@ -95,7 +94,7 @@ def get_or_create_for_external_key(cls, scope: ScopeData) -> "ContentLibraryScop
9594 """
9695 # For glob scopes we don't create a Scope object since
9796 # they don't represent a specific content library
98- if GLOBAL_SCOPE_WILDCARD in scope .external_key :
97+ if scope .IS_GLOB :
9998 return None
10099
101100 library_key = LibraryLocatorV2 .from_string (scope .external_key )
@@ -131,7 +130,7 @@ class CourseScope(Scope):
131130 )
132131
133132 @classmethod
134- def get_or_create_for_external_key (cls , scope : ScopeData ) -> "CourseScope" :
133+ def get_or_create_for_external_key (cls , scope ) -> "CourseScope" :
135134 """Get or create a CourseScope for the given external key.
136135
137136 Args:
@@ -144,7 +143,7 @@ def get_or_create_for_external_key(cls, scope: ScopeData) -> "CourseScope":
144143 """
145144 # For glob scopes we don't create a Scope object
146145 # since they don't represent a specific course
147- if GLOBAL_SCOPE_WILDCARD in scope .external_key :
146+ if scope .IS_GLOB :
148147 return None
149148
150149 course_key = CourseKey .from_string (scope .external_key )
0 commit comments