diff --git a/controllers/user/profile.go b/controllers/user/profile.go index be58d1d3..ad1f6aae 100644 --- a/controllers/user/profile.go +++ b/controllers/user/profile.go @@ -189,9 +189,13 @@ func UserProfileFormHandler(c *gin.Context) { validator.ValidateForm(&userForm, messages) if !messages.HasErrors() { if userForm.Email != userProfile.Email { - email.SendVerificationToUser(currentUser, userForm.Email) - messages.AddInfoTf("infos", "email_changed", userForm.Email) - userForm.Email = userProfile.Email // reset, it will be set when user clicks verification + if currentUser.HasAdmin() { + userProfile.Email = userForm.Email + } else { + email.SendVerificationToUser(currentUser, userForm.Email) + messages.AddInfoTf("infos", "email_changed", userForm.Email) + userForm.Email = userProfile.Email // reset, it will be set when user clicks verification + } } user, _, err := users.UpdateFromRequest(c, &userForm, &userSettingsForm, currentUser, uint(id)) if err != nil {