Skip to content

Commit 9e556e4

Browse files
authored
Allow spaces, - and ' in user first/last names (fixes #591) (#623)
* Allow spaces, - and ' in user first/last names (fixes #591) * changelog * update regex in register method too
1 parent 4018364 commit 9e556e4

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* Allow admins to add/remove project managers
1414
* Fix add/remove manager http returns
1515
* Fix typo in cron due to remove_tp_reservation changes
16+
* Allow spaces, - and ' in user first/last names
1617

1718
## 1.4.32 (2025-04-22)
1819

manager2/src/app/auth/register/register.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export class RegisterComponent implements OnInit {
137137
this.msg = 'User identifier too short (min 4 characters)';
138138
return;
139139
}
140-
if (!this.first_name.match(/^[a-zA-Zà-ü]+$/) || !this.last_name.match(/^[a-zA-Zà-ü]+$/)) {
140+
if (!this.first_name.match(/^[a-zA-Zà-ü -']+$/) || !this.last_name.match(/^[a-zA-Zà-ü -']+$/)) {
141141
this.msg = 'Name contains unauthorized characters';
142142
return;
143143
}

manager2/src/app/user/user.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ export class UserComponent implements OnInit {
754754
this.update_error_msg = 'Missing field: why do you need an account';
755755
return;
756756
}
757-
if (!this.user.firstname.match(/^[a-zA-Zà-ü]+$/) || !this.user.lastname.match(/^[a-zA-Zà-ü]+$/)) {
757+
if (!this.user.firstname.match(/^[a-zA-Zà-ü -']+$/) || !this.user.lastname.match(/^[a-zA-Zà-ü -']+$/)) {
758758
this.update_error_msg = 'Name contains unauthorized characters';
759759
return;
760760
}

0 commit comments

Comments
 (0)