diff options
author | Unknwon <u@gogs.io> | 2015-12-03 00:24:37 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-12-03 00:24:37 -0500 |
commit | cc8f5add6e811cc340e676f0d969a4b1dd551d89 (patch) | |
tree | 413d718eecf77c8910ca3d610942e4ceff23678e /routers/user | |
parent | ec2423ad7c64bbef67ccee4324f2df3efe6792aa (diff) | |
download | gitea-cc8f5add6e811cc340e676f0d969a4b1dd551d89.tar.gz gitea-cc8f5add6e811cc340e676f0d969a4b1dd551d89.zip |
fix #976
Diffstat (limited to 'routers/user')
-rw-r--r-- | routers/user/setting.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/routers/user/setting.go b/routers/user/setting.go index 2e825cf56f..f9704ba946 100644 --- a/routers/user/setting.go +++ b/routers/user/setting.go @@ -295,7 +295,7 @@ func SettingsSSHKeysPost(ctx *middleware.Context, form auth.AddSSHKeyForm) { } } - if err = models.AddPublicKey(ctx.User.Id, form.Title, content); err != nil { + if _, err = models.AddPublicKey(ctx.User.Id, form.Title, content); err != nil { ctx.Data["HasError"] = true switch { case models.IsErrKeyAlreadyExist(err): @@ -315,7 +315,7 @@ func SettingsSSHKeysPost(ctx *middleware.Context, form auth.AddSSHKeyForm) { } func DeleteSSHKey(ctx *middleware.Context) { - if err := models.DeletePublicKey(ctx.QueryInt64("id")); err != nil { + if err := models.DeletePublicKey(ctx.User, ctx.QueryInt64("id")); err != nil { ctx.Flash.Error("DeletePublicKey: " + err.Error()) } else { ctx.Flash.Success(ctx.Tr("settings.ssh_key_deletion_success")) |