Skip to content

Commit cea85c3

Browse files
author
Gusted
authored
Don't update email for organisation (#18905) (#18906)
Backport #18905
1 parent 6039138 commit cea85c3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

models/user/user.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,7 @@ func updateUser(ctx context.Context, u *User, changePrimaryEmail bool, cols ...s
861861
}); err != nil {
862862
return err
863863
}
864-
} else { // check if primary email in email_address table
864+
} else if !u.IsOrganization() { // check if primary email in email_address table
865865
primaryEmailExist, err := e.Where("uid=? AND is_primary=?", u.ID, true).Exist(&EmailAddress{})
866866
if err != nil {
867867
return err

0 commit comments

Comments
 (0)