Skip to content

Commit 29f6962

Browse files
author
Gusted
committed
Don't update email for organisation (go-gitea#18905)
Bacport go-gitea#18905
1 parent 6039138 commit 29f6962

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)