refactor: import constants into platform-wide settings module
This commit is contained in:
committed by
Kyle McCormick
parent
e19577b4d4
commit
36327ff27c
@@ -50,7 +50,6 @@ from django.utils.translation import gettext_lazy as _
|
||||
|
||||
import lms.envs.common
|
||||
|
||||
from openedx.core.constants import COURSE_KEY_REGEX, COURSE_KEY_PATTERN, COURSE_ID_PATTERN
|
||||
from openedx.envs.common import * # pylint: disable=wildcard-import
|
||||
|
||||
from lms.envs.common import (
|
||||
|
||||
@@ -64,7 +64,6 @@ from enterprise.constants import (
|
||||
DEFAULT_ENTERPRISE_ENROLLMENT_INTENTIONS_ROLE,
|
||||
)
|
||||
|
||||
from openedx.core.constants import COURSE_KEY_REGEX, COURSE_KEY_PATTERN, COURSE_ID_PATTERN
|
||||
from openedx.core.lib.derived import Derived
|
||||
from openedx.core.release import doc_version
|
||||
from openedx.envs.common import * # pylint: disable=wildcard-import
|
||||
|
||||
@@ -12,3 +12,8 @@ COURSE_ID_PATTERN = COURSE_KEY_PATTERN.replace('course_key_string', 'course_id')
|
||||
COURSE_KEY_REGEX = COURSE_KEY_PATTERN.replace('P<course_key_string>', ':')
|
||||
COURSE_PUBLISHED = 'published'
|
||||
COURSE_UNPUBLISHED = 'unpublished'
|
||||
|
||||
ASSET_KEY_PATTERN = r'(?P<asset_key_string>(?:/?c4x(:/)?/[^/]+/[^/]+/[^/]+/[^@]+(?:@[^/]+)?)|(?:[^/]+))'
|
||||
|
||||
USAGE_KEY_PATTERN = r'(?P<usage_key_string>(?:i4x://?[^/]+/[^/]+/[^/]+/[^@]+(?:@[^/]+)?)|(?:[^/]+))'
|
||||
USAGE_ID_PATTERN = USAGE_KEY_PATTERN.replace('usage_key_string', 'usage_id')
|
||||
|
||||
@@ -780,9 +780,3 @@ GENERATE_PROFILE_SCORES = False
|
||||
# in the AccountCreationForm and the user_api through the ENABLE_UNICODE_USERNAME feature flag.
|
||||
USERNAME_REGEX_PARTIAL = r'[\w .@_+-]+'
|
||||
USERNAME_PATTERN = fr'(?P<username>{USERNAME_REGEX_PARTIAL})'
|
||||
|
||||
# These are standard regexes for pulling out info like course_ids, usage_ids, etc.
|
||||
# They are used so that URLs with deprecated-format strings still work.
|
||||
USAGE_KEY_PATTERN = r'(?P<usage_key_string>(?:i4x://?[^/]+/[^/]+/[^/]+/[^@]+(?:@[^/]+)?)|(?:[^/]+))'
|
||||
ASSET_KEY_PATTERN = r'(?P<asset_key_string>(?:/?c4x(:/)?/[^/]+/[^/]+/[^/]+/[^@]+(?:@[^/]+)?)|(?:[^/]+))'
|
||||
USAGE_ID_PATTERN = r'(?P<usage_id>(?:i4x://?[^/]+/[^/]+/[^/]+/[^@]+(?:@[^/]+)?)|(?:[^/]+))'
|
||||
|
||||
Reference in New Issue
Block a user