core: userimport: also check duplicate in pending list (#559)

pull/564/head
undefined 1 year ago
parent 77279e0091
commit 41a1a7ae66
No known key found for this signature in database

@ -232,9 +232,9 @@ class SystemUserImportHandler extends SystemHandler {
if (!Types.Email[1](email)) messages.push(`Line ${+i + 1}: Invalid email.`);
else if (!Types.Username[1](username)) messages.push(`Line ${+i + 1}: Invalid username`);
else if (!Types.Password[1](password)) messages.push(`Line ${+i + 1}: Invalid password`);
else if (await user.getByEmail('system', email)) {
else if (udocs.find((t) => t.email === email) || await user.getByEmail('system', email)) {
messages.push(`Line ${+i + 1}: Email ${email} already exists.`);
} else if (await user.getByUname('system', username)) {
} else if (udocs.find((t) => t.username === username) || await user.getByUname('system', username)) {
messages.push(`Line ${+i + 1}: Username ${username} already exists.`);
} else {
const payload: any = {};

Loading…
Cancel
Save