1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-24 21:00:33 +02:00

Add country field in registration

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello
2024-06-07 14:52:09 +02:00
parent 2c15774185
commit 85b3da09f6
9 changed files with 248 additions and 152 deletions

View File

@ -43,9 +43,9 @@ class Team(models.Model):
nb_letters=settings.TEAM_CODE_LENGTH),
unique=True,
validators=[
RegexValidator(fr"^[A-Z]{{f'{settings.TEAM_CODE_LENGTH}'}}$"),
RegexValidator("^[A-Z]{" + str(settings.TEAM_CODE_LENGTH) + "}$"),
RegexValidator(fr"^(?!{'|'.join(f'{t}$' for t in settings.FORBIDDEN_TRIGRAMS)})",
message=_("This trigram is forbidden.")),
message=_("This team code is forbidden.")),
],
)