summaryrefslogtreecommitdiffstats
path: root/routers/user/setting.go
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2014-11-21 12:51:36 -0500
committerUnknwon <joe2010xtmf@163.com>2014-11-21 12:51:36 -0500
commitef275ebf62608b1bd2c7e48862e723cd822d93c2 (patch)
tree1ff4e8cd2a7b85b85b19d03855cb51e6327c3e8a /routers/user/setting.go
parent22ab4fa1b0bdbea10979ae87568452b5bbf9b6af (diff)
downloadgitea-ef275ebf62608b1bd2c7e48862e723cd822d93c2.tar.gz
gitea-ef275ebf62608b1bd2c7e48862e723cd822d93c2.zip
more on change avatar
Diffstat (limited to 'routers/user/setting.go')
-rw-r--r--routers/user/setting.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/routers/user/setting.go b/routers/user/setting.go
index 559e10fd89..7aeb349727 100644
--- a/routers/user/setting.go
+++ b/routers/user/setting.go
@@ -88,6 +88,11 @@ func SettingsPost(ctx *middleware.Context, form auth.UpdateProfileForm) {
func SettingsAvatar(ctx *middleware.Context, form auth.UploadAvatarForm) {
defer ctx.Redirect(setting.AppSubUrl + "/user/settings")
+ ctx.User.UseCustomAvatar = form.Enable
+ if err := models.UpdateUser(ctx.User); err != nil {
+ ctx.Flash.Error(err.Error())
+ }
+
if form.Avatar != nil {
fr, err := form.Avatar.Open()
if err != nil {
@@ -108,8 +113,8 @@ func SettingsAvatar(ctx *middleware.Context, form auth.UploadAvatarForm) {
ctx.Flash.Error(err.Error())
return
}
- ctx.Flash.Success(ctx.Tr("settings.upload_avatar_success"))
}
+ ctx.Flash.Success(ctx.Tr("settings.update_avatar_success"))
}
func SettingsPassword(ctx *middleware.Context) {