summaryrefslogtreecommitdiffstats
path: root/routers/user
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-09-06 16:31:22 -0400
committerUnknwon <u@gogs.io>2015-09-06 16:31:22 -0400
commit85f34ba53843177999cb98bad046e9cce22bfc8f (patch)
treef1f7ca6d3b0fc4848216becd9bc2a25e019cb12e /routers/user
parent00767a0522606cd504d81d35fa1d9e9c1e34610c (diff)
downloadgitea-85f34ba53843177999cb98bad046e9cce22bfc8f.tar.gz
gitea-85f34ba53843177999cb98bad046e9cce22bfc8f.zip
new user profile settings UI
Signed-off-by: Unknwon <u@gogs.io>
Diffstat (limited to 'routers/user')
-rw-r--r--routers/user/setting.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/routers/user/setting.go b/routers/user/setting.go
index 8afc56ac49..f2f5a6cd93 100644
--- a/routers/user/setting.go
+++ b/routers/user/setting.go
@@ -47,11 +47,11 @@ func SettingsPost(ctx *middleware.Context, form auth.UpdateProfileForm) {
}
// Check if user name has been changed.
- if ctx.User.Name != form.UserName {
- if err := models.ChangeUserName(ctx.User, form.UserName); err != nil {
+ if ctx.User.Name != form.Name {
+ if err := models.ChangeUserName(ctx.User, form.Name); err != nil {
switch {
case models.IsErrUserAlreadyExist(err):
- ctx.Flash.Error(ctx.Tr("form.username_been_taken"))
+ ctx.Flash.Error(ctx.Tr("form.name_been_taken"))
ctx.Redirect(setting.AppSubUrl + "/user/settings")
case models.IsErrEmailAlreadyUsed(err):
ctx.Flash.Error(ctx.Tr("form.email_been_used"))
@@ -67,16 +67,16 @@ func SettingsPost(ctx *middleware.Context, form auth.UpdateProfileForm) {
}
return
}
- log.Trace("User name changed: %s -> %s", ctx.User.Name, form.UserName)
- ctx.User.Name = form.UserName
+ log.Trace("User name changed: %s -> %s", ctx.User.Name, form.Name)
+ ctx.User.Name = form.Name
}
ctx.User.FullName = form.FullName
ctx.User.Email = form.Email
ctx.User.Website = form.Website
ctx.User.Location = form.Location
- ctx.User.Avatar = base.EncodeMd5(form.Avatar)
- ctx.User.AvatarEmail = form.Avatar
+ ctx.User.Avatar = base.EncodeMd5(form.Gravatar)
+ ctx.User.AvatarEmail = form.Gravatar
if err := models.UpdateUser(ctx.User); err != nil {
ctx.Handle(500, "UpdateUser", err)
return