Update users.ts (#9024)

This commit is contained in:
Aiden Foxx
2021-10-21 19:49:15 +02:00
committed by GitHub
parent 5741fcce57
commit f6b250e25c

View File

@@ -183,7 +183,14 @@ export class UsersService extends ItemsService {
}
if (data.email) {
await this.checkUniqueEmails([data.email]);
if (keys.length > 1) {
throw new RecordNotUniqueException('email', {
collection: 'directus_users',
field: 'email',
invalid: data.email,
});
}
await this.checkUniqueEmails([data.email], keys[0]);
}
if (data.password) {