Skip to content

Commit

Permalink
🦺(backend) add comma to sub regex
Browse files Browse the repository at this point in the history
Some sub have comma, the regex was a bit too strict
and didn't allow it, this commit fixes that.
  • Loading branch information
AntoLC committed Nov 8, 2024
1 parent ac40eb8 commit 526e649
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ and this project adheres to
- 🚸(backend) improve users similarity search and sort results #391
- 🌐(backend) add german translation #259

## Fixed

- 🦺(backend) add comma to sub regex #408


## [1.7.0] - 2024-10-24

## Added
Expand Down
6 changes: 3 additions & 3 deletions src/backend/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,17 +130,17 @@ class User(AbstractBaseUser, BaseModel, auth_models.PermissionsMixin):
"""User model to work with OIDC only authentication."""

sub_validator = validators.RegexValidator(
regex=r"^[\w.@+-]+\Z",
regex=r"^[\w.@+-:]+\Z",
message=_(
"Enter a valid sub. This value may contain only letters, "
"numbers, and @/./+/-/_ characters."
"numbers, and @/./+/-/_/: characters."
),
)

sub = models.CharField(
_("sub"),
help_text=_(
"Required. 255 characters or fewer. Letters, numbers, and @/./+/-/_ characters only."
"Required. 255 characters or fewer. Letters, numbers, and @/./+/-/_/: characters only."
),
max_length=255,
unique=True,
Expand Down

0 comments on commit 526e649

Please sign in to comment.