File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5050
5151import lms .envs .common
5252
53- from openedx .core .constants import COURSE_KEY_REGEX , COURSE_KEY_PATTERN , COURSE_ID_PATTERN
5453from openedx .envs .common import * # pylint: disable=wildcard-import
5554
5655from lms .envs .common import (
Original file line number Diff line number Diff line change 6464 DEFAULT_ENTERPRISE_ENROLLMENT_INTENTIONS_ROLE ,
6565)
6666
67- from openedx .core .constants import COURSE_KEY_REGEX , COURSE_KEY_PATTERN , COURSE_ID_PATTERN
6867from openedx .core .lib .derived import Derived
6968from openedx .core .release import doc_version
7069from openedx .envs .common import * # pylint: disable=wildcard-import
Original file line number Diff line number Diff line change 1212COURSE_KEY_REGEX = COURSE_KEY_PATTERN .replace ('P<course_key_string>' , ':' )
1313COURSE_PUBLISHED = 'published'
1414COURSE_UNPUBLISHED = 'unpublished'
15+
16+ ASSET_KEY_PATTERN = r'(?P<asset_key_string>(?:/?c4x(:/)?/[^/]+/[^/]+/[^/]+/[^@]+(?:@[^/]+)?)|(?:[^/]+))'
17+
18+ USAGE_KEY_PATTERN = r'(?P<usage_key_string>(?:i4x://?[^/]+/[^/]+/[^/]+/[^@]+(?:@[^/]+)?)|(?:[^/]+))'
19+ USAGE_ID_PATTERN = USAGE_KEY_PATTERN .replace ('usage_key_string' , 'usage_id' )
Original file line number Diff line number Diff line change @@ -780,9 +780,3 @@ def _make_locale_paths(settings):
780780# in the AccountCreationForm and the user_api through the ENABLE_UNICODE_USERNAME feature flag.
781781USERNAME_REGEX_PARTIAL = r'[\w .@_+-]+'
782782USERNAME_PATTERN = fr'(?P<username>{ USERNAME_REGEX_PARTIAL } )'
783-
784- # These are standard regexes for pulling out info like course_ids, usage_ids, etc.
785- # They are used so that URLs with deprecated-format strings still work.
786- USAGE_KEY_PATTERN = r'(?P<usage_key_string>(?:i4x://?[^/]+/[^/]+/[^/]+/[^@]+(?:@[^/]+)?)|(?:[^/]+))'
787- ASSET_KEY_PATTERN = r'(?P<asset_key_string>(?:/?c4x(:/)?/[^/]+/[^/]+/[^/]+/[^@]+(?:@[^/]+)?)|(?:[^/]+))'
788- USAGE_ID_PATTERN = r'(?P<usage_id>(?:i4x://?[^/]+/[^/]+/[^/]+/[^@]+(?:@[^/]+)?)|(?:[^/]+))'
You can’t perform that action at this time.
0 commit comments