Skip to content

Commit

Permalink
refactor: Rename USAGE_ID_REGEXP to COLLECTION_ID_REGEXP in LibraryCo…
Browse files Browse the repository at this point in the history
…llectionLocator
  • Loading branch information
ChrisChV committed Sep 4, 2024
1 parent 97d46a5 commit 780e4b2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions opaque_keys/edx/locator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1636,8 +1636,8 @@ class LibraryCollectionLocator(CheckFieldMixin, LibraryCollectionKey):
__slots__ = KEY_FIELDS
CHECKED_INIT = False

# Allow usage IDs to contian unicode characters
USAGE_ID_REGEXP = re.compile(r'^[\w\-.]+$', flags=re.UNICODE)
# Allow collection IDs to contian unicode characters
COLLECTION_ID_REGEXP = re.compile(r'^[\w\-.]+$', flags=re.UNICODE)

def __init__(self, library_key: LibraryLocatorV2, collection_id: str):
"""
Expand All @@ -1646,7 +1646,7 @@ def __init__(self, library_key: LibraryLocatorV2, collection_id: str):
if not isinstance(library_key, LibraryLocatorV2):
raise TypeError("library_key must be a LibraryLocatorV2")

self._check_key_string_field("collection_id", collection_id, regexp=self.USAGE_ID_REGEXP)
self._check_key_string_field("collection_id", collection_id, regexp=self.COLLECTION_ID_REGEXP)
super().__init__(
library_key=library_key,
collection_id=collection_id,
Expand Down

0 comments on commit 780e4b2

Please sign in to comment.