mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Fix update user (#18878)
This commit is contained in:
		@@ -868,13 +868,14 @@ func updateUser(ctx context.Context, u *User, changePrimaryEmail bool, cols ...s
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if !primaryEmailExist {
 | 
			
		||||
			_, err = e.Insert(&EmailAddress{
 | 
			
		||||
			if _, err := e.Insert(&EmailAddress{
 | 
			
		||||
				Email:       u.Email,
 | 
			
		||||
				UID:         u.ID,
 | 
			
		||||
				IsActivated: true,
 | 
			
		||||
				IsPrimary:   true,
 | 
			
		||||
			})
 | 
			
		||||
			return err
 | 
			
		||||
			}); err != nil {
 | 
			
		||||
				return err
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user