mirror of
https://github.com/go-gitea/gitea.git
synced 2026-11-06 12:55:58 +00:00
backport #40186 Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
1 parent
4f536f1513
commit
b9a99f0f3e
2 files changed
+6
-6
No files matched your search
@@ -68,7 +68,7 @@ func ProfilePost(ctx *context.Context) {
|
||||
|
||||
if form.Name != "" {
|
||||
if user_model.IsFeatureDisabledWithLoginType(ctx.Doer, setting.UserFeatureChangeUsername) {
|
||||
ctx.Flash.Error(ctx.Tr("user.form.change_username_disabled"))
|
||||
ctx.Flash.Error(ctx.Tr("form.change_username_disabled"))
|
||||
ctx.Redirect(setting.AppSubURL + "/user/settings")
|
||||
return
|
||||
}
|
||||
@@ -102,13 +102,13 @@ func ProfilePost(ctx *context.Context) {
|
||||
KeepActivityPrivate: optional.Some(form.KeepActivityPrivate),
|
||||
}
|
||||
|
||||
if form.FullName != "" {
|
||||
if form.FullName != nil {
|
||||
if user_model.IsFeatureDisabledWithLoginType(ctx.Doer, setting.UserFeatureChangeFullName) {
|
||||
ctx.Flash.Error(ctx.Tr("user.form.change_full_name_disabled"))
|
||||
ctx.Flash.Error(ctx.Tr("form.change_full_name_disabled"))
|
||||
ctx.Redirect(setting.AppSubURL + "/user/settings")
|
||||
return
|
||||
}
|
||||
opts.FullName = optional.Some(form.FullName)
|
||||
opts.FullName = optional.FromPtr(form.FullName)
|
||||
}
|
||||
|
||||
if err := user_service.UpdateUser(ctx, ctx.Doer, opts); err != nil {
|
||||
|
||||
@@ -160,8 +160,8 @@ type IntrospectTokenForm struct {
|
||||
// UpdateProfileForm form for updating profile
|
||||
type UpdateProfileForm struct {
|
||||
middleware.FormDefaultValidator
|
||||
Name string `binding:"Username;MaxSize(40)"`
|
||||
FullName string `binding:"MaxSize(100)"`
|
||||
Name string `binding:"Username;MaxSize(40)"`
|
||||
FullName *string `binding:"MaxSize(100)"`
|
||||
KeepEmailPrivate bool
|
||||
Website string `binding:"ValidSiteUrl;MaxSize(255)"`
|
||||
Location string `binding:"MaxSize(50)"`
|
||||
|
||||
Reference in new issue
Block a user