From 54af62db1297bcc8c783d6d75e6c05661788239e Mon Sep 17 00:00:00 2001 From: Remy Siminel <95074810+rsiminel@users.noreply.github.com> Date: Wed, 11 Dec 2024 16:01:43 +0100 Subject: [PATCH] Username accents (#564) * add accents to update front * allow accents in names for user registration * update changelog --- CHANGELOG.md | 1 + manager2/src/app/auth/register/register.component.ts | 2 +- manager2/src/app/user/user.component.ts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 83dbfc34..be3a78be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ * increase size of input field in users page * add a readonly input field under email for showing the email domain* * Add "custom_users" key to config file, to be used with various scripts +* Allow accents in user's first and last names ## 1.4.31 (2024-09-27) diff --git a/manager2/src/app/auth/register/register.component.ts b/manager2/src/app/auth/register/register.component.ts index e1cc696f..af9051ae 100644 --- a/manager2/src/app/auth/register/register.component.ts +++ b/manager2/src/app/auth/register/register.component.ts @@ -142,7 +142,7 @@ export class RegisterComponent implements OnInit { this.msg="User identifier too short (min 4 characters)"; return; } - if (!this.first_name.match(/^[a-zA-Z]+$/) || !this.last_name.match(/^[a-zA-Z]+$/)) { + if (!this.first_name.match(/^[a-zA-Zà-ü]+$/) || !this.last_name.match(/^[a-zA-Zà-ü]+$/)) { this.msg = 'Name contains unauthorized characters'; return; } diff --git a/manager2/src/app/user/user.component.ts b/manager2/src/app/user/user.component.ts index 8a6997a3..71badfdc 100644 --- a/manager2/src/app/user/user.component.ts +++ b/manager2/src/app/user/user.component.ts @@ -754,7 +754,7 @@ export class UserComponent implements OnInit { this.update_error_msg = 'Missing field: why do you need an account'; return; } - if (!this.user.firstname.match(/^[a-zA-Z]+$/) || !this.user.lastname.match(/^[a-zA-Z]+$/)) { + if (!this.user.firstname.match(/^[a-zA-Zà-ü]+$/) || !this.user.lastname.match(/^[a-zA-Zà-ü]+$/)) { this.update_error_msg = 'Name contains unauthorized characters'; return; }