fix delete user failed on sqlite (#1321)

tokarchuk/v1.17
Lunny Xiao 8 years ago committed by GitHub
parent bd8fe49076
commit 888dee3b5f
  1. 6
      models/external_login_user.go
  2. 2
      models/user.go

@ -67,8 +67,8 @@ func RemoveAccountLink(user *User, loginSourceID int64) (int64, error) {
return deleted, err
}
// RemoveAllAccountLinks will remove all external login sources for the given user
func RemoveAllAccountLinks(user *User) error {
_, err := x.Delete(&ExternalLoginUser{UserID: user.ID})
// removeAllAccountLinks will remove all external login sources for the given user
func removeAllAccountLinks(e Engine, user *User) error {
_, err := e.Delete(&ExternalLoginUser{UserID: user.ID})
return err
}

@ -990,7 +990,7 @@ func deleteUser(e *xorm.Session, u *User) error {
}
// ***** START: ExternalLoginUser *****
if err = RemoveAllAccountLinks(u); err != nil {
if err = removeAllAccountLinks(e, u); err != nil {
return fmt.Errorf("ExternalLoginUser: %v", err)
}
// ***** END: ExternalLoginUser *****

Loading…
Cancel
Save