Improve delete SSH key

This commit is contained in:
Unknown 2014-05-06 16:28:52 -04:00
parent 7cb5a15c9b
commit 8ca14e2109
14 changed files with 49 additions and 101 deletions

View file

@ -154,12 +154,8 @@ func SettingSSHKeys(ctx *middleware.Context, form auth.AddSSHKeyForm) {
})
return
}
k := &models.PublicKey{
Id: id,
OwnerId: ctx.User.Id,
}
if err = models.DeletePublicKey(k); err != nil {
if err = models.DeletePublicKey(&models.PublicKey{Id: id}); err != nil {
log.Error("ssh.DelPublicKey: %v", err)
ctx.JSON(200, map[string]interface{}{
"ok": false,