mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-30 20:06:19 +00:00
[MINOR] Fix Email Updates (#17620)
* Fix Email * Fix Test (cherry picked from commit a9a1a2036b55fb2cf03c6535733059d364ef6310)
This commit is contained in:
parent
aff2adbb98
commit
c23fdc88b4
@ -578,7 +578,7 @@ public class UserRepository extends EntityRepository<User> {
|
||||
@Override
|
||||
public void entitySpecificUpdate() {
|
||||
// LowerCase Email
|
||||
updated.setEmail(updated.getEmail().toLowerCase());
|
||||
updated.setEmail(original.getEmail().toLowerCase());
|
||||
|
||||
// Updates
|
||||
updateRoles(original, updated);
|
||||
@ -590,7 +590,6 @@ public class UserRepository extends EntityRepository<User> {
|
||||
recordChange("timezone", original.getTimezone(), updated.getTimezone());
|
||||
recordChange("isBot", original.getIsBot(), updated.getIsBot());
|
||||
recordChange("isAdmin", original.getIsAdmin(), updated.getIsAdmin());
|
||||
recordChange("email", original.getEmail(), updated.getEmail().toLowerCase());
|
||||
recordChange("isEmailVerified", original.getIsEmailVerified(), updated.getIsEmailVerified());
|
||||
updateAuthenticationMechanism(original, updated);
|
||||
}
|
||||
|
@ -305,13 +305,13 @@ public class UserResourceTest extends EntityResourceTest<User, CreateUser> {
|
||||
|
||||
// Update the user information using PUT
|
||||
String oldEmail = create.getEmail();
|
||||
// Even with new field being updated, this shouuld not take effect
|
||||
CreateUser update = create.withEmail("user.xyz@email.com").withDisplayName("displayName1");
|
||||
|
||||
ChangeDescription change = getChangeDescription(user, MINOR_UPDATE);
|
||||
fieldAdded(change, "displayName", "displayName1");
|
||||
fieldUpdated(change, "email", oldEmail, "user.xyz@email.com");
|
||||
user = updateAndCheckEntity(update, OK, ADMIN_AUTH_HEADERS, MINOR_UPDATE, change);
|
||||
|
||||
assertEquals(oldEmail, user.getEmail());
|
||||
// Update the user information using PUT as the logged-in user
|
||||
update = create.withDisplayName("displayName2");
|
||||
change = getChangeDescription(user, MINOR_UPDATE);
|
||||
|
Loading…
x
Reference in New Issue
Block a user