diff --git a/routers/web/user/setting/profile.go b/routers/web/user/setting/profile.go index 8ea726a49..839746ecf 100644 --- a/routers/web/user/setting/profile.go +++ b/routers/web/user/setting/profile.go @@ -45,12 +45,6 @@ func Profile(ctx *context.Context) { // HandleUsernameChange handle username changes from user settings and admin interface func HandleUsernameChange(ctx *context.Context, user *models.User, newName string) error { - // Non-local users are not allowed to change their username. - if !user.IsLocal() { - ctx.Flash.Error(ctx.Tr("form.username_change_not_local_user")) - return fmt.Errorf(ctx.Tr("form.username_change_not_local_user")) - } - // Check if user name has been changed if user.LowerName != strings.ToLower(newName) { if err := models.ChangeUserName(user, newName); err != nil { diff --git a/templates/user/settings/profile.tmpl b/templates/user/settings/profile.tmpl index 1f1585a78..f048dfc60 100644 --- a/templates/user/settings/profile.tmpl +++ b/templates/user/settings/profile.tmpl @@ -15,8 +15,8 @@ {{.i18n.Tr "settings.change_username_prompt"}} {{.i18n.Tr "settings.change_username_redirect_prompt"}} - - {{if or (not .SignedUser.IsLocal) .IsReverseProxy}} + + {{if .IsReverseProxy}}

{{$.i18n.Tr "settings.password_username_disabled"}}

{{end}}