From 526e649f06fcdb3c09c40a7befe3eba28ab7f3a2 Mon Sep 17 00:00:00 2001 From: Anthony LC Date: Fri, 8 Nov 2024 10:27:09 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A6=BA(backend)=20add=20comma=20to=20sub?= =?UTF-8?q?=20regex?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some sub have comma, the regex was a bit too strict and didn't allow it, this commit fixes that. --- CHANGELOG.md | 5 +++++ src/backend/core/models.py | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c320bb2..16bd5a3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/backend/core/models.py b/src/backend/core/models.py index c8080b43..73246705 100644 --- a/src/backend/core/models.py +++ b/src/backend/core/models.py @@ -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,