aboutsummaryrefslogtreecommitdiffstats
path: root/routers/user
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-12-11 15:31:02 -0500
committerUnknwon <u@gogs.io>2015-12-11 15:31:02 -0500
commitd0b0d24f22f117eb6ae41a5180b8cdb7d957ac55 (patch)
treefbfff51c5aa2463e56145f6e2a62e42f1dff3d66 /routers/user
parent5d95ffe3eb216845606b7652160865eb1dd58111 (diff)
downloadgitea-d0b0d24f22f117eb6ae41a5180b8cdb7d957ac55.tar.gz
gitea-d0b0d24f22f117eb6ae41a5180b8cdb7d957ac55.zip
#2154 disable change user for non-local users
- #2153 remove require for gravatar
Diffstat (limited to 'routers/user')
-rw-r--r--routers/user/setting.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/routers/user/setting.go b/routers/user/setting.go
index f9704ba946..9a9aa57e07 100644
--- a/routers/user/setting.go
+++ b/routers/user/setting.go
@@ -79,8 +79,10 @@ func SettingsPost(ctx *middleware.Context, form auth.UpdateProfileForm) {
ctx.User.Email = form.Email
ctx.User.Website = form.Website
ctx.User.Location = form.Location
- ctx.User.Avatar = base.EncodeMD5(form.Gravatar)
- ctx.User.AvatarEmail = form.Gravatar
+ if len(form.Gravatar) > 0 {
+ 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