Skip to content

Commit b3daece

Browse files
committed
fix(squash): regex style; remove inaccurate migration comment
1 parent e8d2657 commit b3daece

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

src/openedx_content/migrations/0007_rename_collection_key_to_collection_code.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
"""
22
Rename Collection.key -> Collection.collection_code and change from key_field to code_field.
3-
4-
Squashed from 0007–0010.
53
"""
64
import re
75

@@ -42,7 +40,7 @@ class Migration(migrations.Migration):
4240
max_length=255,
4341
validators=[
4442
django.core.validators.RegexValidator(
45-
re.compile('^[a-zA-Z0-9\\-\\_\\.]+\\Z'),
43+
re.compile('^[a-zA-Z0-9_.-]+\\Z'),
4644
'Enter a valid "code name" consisting of letters, numbers, underscores, hyphens, or periods.',
4745
'invalid',
4846
),
@@ -63,7 +61,7 @@ class Migration(migrations.Migration):
6361
constraint=models.CheckConstraint(
6462
condition=django.db.models.lookups.Regex(
6563
models.F('collection_code'),
66-
'^[a-zA-Z0-9\\-\\_\\.]+\\Z',
64+
'^[a-zA-Z0-9_.-]+\\Z',
6765
),
6866
name='oel_coll_collection_code_regex',
6967
violation_error_message=(

src/openedx_django_lib/fields.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def immutable_uuid_field() -> models.UUIDField:
119119

120120

121121
# Alphanumeric, hyphens, underscores, periods
122-
CODE_REGEX = re.compile(r"^[a-zA-Z0-9\-\_\.]+\Z")
122+
CODE_REGEX = re.compile(r"^[a-zA-Z0-9_.-]+\Z")
123123

124124

125125
_CODE_VIOLATION_MSG = _(

0 commit comments

Comments
 (0)