Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix forgot removed records when deleting user #5429

Merged
merged 4 commits into from
Dec 18, 2018

Conversation

lunny
Copy link
Member

@lunny lunny commented Nov 29, 2018

Will fix #5356 and replace #5357 , also update xorm to latest stable version.

@lunny lunny added the type/bug label Nov 29, 2018
@bkcsoft bkcsoft added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Nov 29, 2018
@lafriks lafriks added this to the 1.7.0 milestone Nov 29, 2018
@lafriks
Copy link
Member

lafriks commented Nov 29, 2018

@lunny looks like xorm update has broken our unit tests..

@lunny
Copy link
Member Author

lunny commented Nov 30, 2018

@lafriks yes, will fix that.

@codecov-io
Copy link

codecov-io commented Dec 9, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@0bd802e). Click here to learn what that means.
The diff coverage is 29.03%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #5429   +/-   ##
=========================================
  Coverage          ?   37.62%           
=========================================
  Files             ?      320           
  Lines             ?    46974           
  Branches          ?        0           
=========================================
  Hits              ?    17673           
  Misses            ?    26791           
  Partials          ?     2510
Impacted Files Coverage Δ
models/migrations/migrations.go 2.61% <ø> (ø)
models/migrations/v75.go 0% <0%> (ø)
models/user.go 45.93% <60%> (ø)
models/ssh_key.go 39.04% <75%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0bd802e...18bdf78. Read the comment docs.

@lunny
Copy link
Member Author

lunny commented Dec 9, 2018

@lafriks fixed.

@kolaente
Copy link
Member

Conflicts.

@lunny lunny force-pushed the lunny/fix_delete_user branch 2 times, most recently from 91bba2d to 18bdf78 Compare December 12, 2018 17:06
return fmt.Errorf("deletePublicKeys: %v", err)
}
rewriteAllPublicKeys(e)
// ***** END: PublicKey *****
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RewriteAllPublicKeys is called at the end of DeleteUser too, does it still need to be called there?

models/user.go Outdated
@@ -1087,6 +1088,7 @@ func DeleteUser(u *User) (err error) {
if err = sess.Commit(); err != nil {
return err
}
sess.Close()

return RewriteAllPublicKeys()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above

@lunny
Copy link
Member Author

lunny commented Dec 18, 2018

@zeripath Good catch. Done.

@bkcsoft bkcsoft added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Dec 18, 2018
@techknowlogick techknowlogick merged commit fe55ab2 into go-gitea:master Dec 18, 2018
@zeripath
Copy link
Contributor

@lunny Does this need backporting?

@lunny lunny added backport/done All backports for this PR have been created backport/v1.6 labels Dec 19, 2018
@lunny
Copy link
Member Author

lunny commented Dec 19, 2018

@zeripath #5509 is the backport of this one.

@lunny lunny deleted the lunny/fix_delete_user branch December 19, 2018 01:15
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GPG-Keys don't get deleted when deleting an account
7 participants