Skip to content

Commit 08f1f9d

Browse files
committed
Fix update user bug
1 parent b539b38 commit 08f1f9d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

models/user/user.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -868,13 +868,14 @@ func updateUser(ctx context.Context, u *User, changePrimaryEmail bool, cols ...s
868868
}
869869

870870
if !primaryEmailExist {
871-
_, err = e.Insert(&EmailAddress{
871+
if _, err = e.Insert(&EmailAddress{
872872
Email: u.Email,
873873
UID: u.ID,
874874
IsActivated: true,
875875
IsPrimary: true,
876-
})
877-
return err
876+
}); err != nil {
877+
return err
878+
}
878879
}
879880
}
880881

0 commit comments

Comments
 (0)