Ensure that the user management dialog should not allow the same email addresses

with different letter casings when creating users. #5262
This commit is contained in:
Akshay Joshi 2022-09-22 13:13:29 +05:30
parent 0203bbc7ef
commit ed1184fcf8
2 changed files with 3 additions and 2 deletions

View File

@ -25,4 +25,5 @@ Bug fixes
*********
| `Issue #5249 <https://github.com/pgadmin-org/pgadmin4/issues/5249>`_ - Added the ability to display the selected text from the query tool in the find/replace box.
| `Issue #5262 <https://github.com/pgadmin-org/pgadmin4/issues/5262>`_ - Ensure that the user management dialog should not allow the same email addresses with different letter casings when creating users.
| `Issue #5308 <https://github.com/pgadmin-org/pgadmin4/issues/5308>`_ - Ensure that the default value for a column should be used if it is made empty.

View File

@ -145,7 +145,7 @@ class UserManagementCollection extends BaseUISchema {
if (obj.isNew(state) && obj.top?._sessData?.userManagement) {
for (let i=0; i < obj.top._sessData.userManagement.length; i++) {
if (obj.top._sessData.userManagement[i]?.id &&
obj.top._sessData.userManagement[i].username == state.username &&
obj.top._sessData.userManagement[i].username.toLowerCase() == state.username.toLowerCase() &&
obj.top._sessData.userManagement[i].auth_source == state.auth_source) {
msg = gettext('User name \'%s\' already exists', state.username);
setError('username', msg);
@ -172,7 +172,7 @@ class UserManagementCollection extends BaseUISchema {
if (obj.isNew(state) && obj.top?._sessData?.userManagement) {
for (let i=0; i < obj.top._sessData.userManagement.length; i++) {
if (obj.top._sessData.userManagement[i]?.id &&
obj.top._sessData.userManagement[i].email == state.email) {
obj.top._sessData.userManagement[i].email.toLowerCase() == state.email.toLowerCase()) {
msg = gettext('Email address \'%s\' already exists', state.email);
setError('email', msg);
return true;