🦺(backend) add comma to sub regex

Some sub have comma, the regex was a bit too strict
and didn't allow it, this commit fixes that.
This commit is contained in:
Anthony LC
2024-11-08 10:27:09 +01:00
committed by Anthony LC
parent ac40eb8f7c
commit 526e649f06
2 changed files with 8 additions and 3 deletions

View File

@@ -18,6 +18,11 @@ and this project adheres to
- 🚸(backend) improve users similarity search and sort results #391 - 🚸(backend) improve users similarity search and sort results #391
- 🌐(backend) add german translation #259 - 🌐(backend) add german translation #259
## Fixed
- 🦺(backend) add comma to sub regex #408
## [1.7.0] - 2024-10-24 ## [1.7.0] - 2024-10-24
## Added ## Added

View File

@@ -130,17 +130,17 @@ class User(AbstractBaseUser, BaseModel, auth_models.PermissionsMixin):
"""User model to work with OIDC only authentication.""" """User model to work with OIDC only authentication."""
sub_validator = validators.RegexValidator( sub_validator = validators.RegexValidator(
regex=r"^[\w.@+-]+\Z", regex=r"^[\w.@+-:]+\Z",
message=_( message=_(
"Enter a valid sub. This value may contain only letters, " "Enter a valid sub. This value may contain only letters, "
"numbers, and @/./+/-/_ characters." "numbers, and @/./+/-/_/: characters."
), ),
) )
sub = models.CharField( sub = models.CharField(
_("sub"), _("sub"),
help_text=_( 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, max_length=255,
unique=True, unique=True,