summaryrefslogtreecommitdiffstats
path: root/routers/user
diff options
context:
space:
mode:
authorMarios Andreopoulos <opensource@andmarios.com>2014-08-25 20:20:44 +0300
committerMarios Andreopoulos <opensource@andmarios.com>2014-08-25 20:20:44 +0300
commit3d79f59671b7e74ea1c66cb7bcb09bc85575e787 (patch)
tree913d7b97334e5edddfe1a506c60ddc862e873121 /routers/user
parentb40922f4d47001dcd7eeff811fcb96462e4bda41 (diff)
downloadgitea-3d79f59671b7e74ea1c66cb7bcb09bc85575e787.tar.gz
gitea-3d79f59671b7e74ea1c66cb7bcb09bc85575e787.zip
fix wrong variable name
Diffstat (limited to 'routers/user')
-rw-r--r--routers/user/setting.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/routers/user/setting.go b/routers/user/setting.go
index 51a647e3a5..028e75212d 100644
--- a/routers/user/setting.go
+++ b/routers/user/setting.go
@@ -172,9 +172,9 @@ func SettingsSSHKeysPost(ctx *middleware.Context, form auth.AddSSHKeyForm) {
}
// Remove newline characters from form.KeyContent
- cleanKeyContent := strings.Replace(form.KeyContent, "\n", "", -1)
+ cleanContent := strings.Replace(form.Content, "\n", "", -1)
- if ok, err := models.CheckPublicKeyString(cleanKeyContent); !ok {
+ if ok, err := models.CheckPublicKeyString(cleanContent); !ok {
ctx.Flash.Error(ctx.Tr("form.invalid_ssh_key", err.Error()))
ctx.Redirect("/user/settings/ssh")
return
@@ -183,7 +183,7 @@ func SettingsSSHKeysPost(ctx *middleware.Context, form auth.AddSSHKeyForm) {
k := &models.PublicKey{
OwnerId: ctx.User.Id,
Name: form.SSHTitle,
- Content: cleanKeyContent,
+ Content: cleanContent,
}
if err := models.AddPublicKey(k); err != nil {
if err == models.ErrKeyAlreadyExist {