|
|
@ -19,6 +19,7 @@ import ( |
|
|
|
"code.gitea.io/gitea/modules/context" |
|
|
|
"code.gitea.io/gitea/modules/context" |
|
|
|
"code.gitea.io/gitea/modules/log" |
|
|
|
"code.gitea.io/gitea/modules/log" |
|
|
|
"code.gitea.io/gitea/modules/setting" |
|
|
|
"code.gitea.io/gitea/modules/setting" |
|
|
|
|
|
|
|
"code.gitea.io/gitea/modules/util" |
|
|
|
|
|
|
|
|
|
|
|
"github.com/unknwon/i18n" |
|
|
|
"github.com/unknwon/i18n" |
|
|
|
) |
|
|
|
) |
|
|
@ -94,7 +95,14 @@ func ProfilePost(ctx *context.Context, form auth.UpdateProfileForm) { |
|
|
|
ctx.User.KeepEmailPrivate = form.KeepEmailPrivate |
|
|
|
ctx.User.KeepEmailPrivate = form.KeepEmailPrivate |
|
|
|
ctx.User.Website = form.Website |
|
|
|
ctx.User.Website = form.Website |
|
|
|
ctx.User.Location = form.Location |
|
|
|
ctx.User.Location = form.Location |
|
|
|
|
|
|
|
if len(form.Language) != 0 { |
|
|
|
|
|
|
|
if !util.IsStringInSlice(form.Language, setting.Langs) { |
|
|
|
|
|
|
|
ctx.Flash.Error(ctx.Tr("settings.update_language_not_found", form.Language)) |
|
|
|
|
|
|
|
ctx.Redirect(setting.AppSubURL + "/user/settings") |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
ctx.User.Language = form.Language |
|
|
|
ctx.User.Language = form.Language |
|
|
|
|
|
|
|
} |
|
|
|
ctx.User.Description = form.Description |
|
|
|
ctx.User.Description = form.Description |
|
|
|
ctx.User.KeepActivityPrivate = form.KeepActivityPrivate |
|
|
|
ctx.User.KeepActivityPrivate = form.KeepActivityPrivate |
|
|
|
if err := models.UpdateUserSetting(ctx.User); err != nil { |
|
|
|
if err := models.UpdateUserSetting(ctx.User); err != nil { |
|
|
|