Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support system/user default clone editors #22378

Closed
wants to merge 16 commits into from
Prev Previous commit
Next Next commit
fix unnecessary argument
  • Loading branch information
lunny committed Jan 10, 2023
commit 58a6a08833a8c43c4c1f04e974bc6c7de2f8ceb5
6 changes: 1 addition & 5 deletions routers/web/admin/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,7 @@ func Config(ctx *context.Context) {
ctx.Data["EnableXORMLog"] = setting.EnableXORMLog
ctx.Data["LogSQL"] = setting.Database.LogSQL

editors, err := dev.GetEditors()
if err != nil {
ctx.ServerError("system_model.GetAllSettings", err)
return
}
editors := dev.GetEditors()

defaultEditorS := systemSettings.Get(dev.KeyDevDefaultEditors)
if defaultEditorS.SettingValue == "" {
Expand Down
6 changes: 1 addition & 5 deletions routers/web/user/setting/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,11 +376,7 @@ func Appearance(ctx *context.Context) {
return forms.IsUserHiddenCommentTypeGroupChecked(commentTypeGroup, hiddenCommentTypes)
}

editors, err := dev.GetEditors()
if err != nil {
ctx.ServerError("dev.GetEditors", err)
return
}
editors := dev.GetEditors()

myDefaultEditors, err := dev.GetUserDefaultEditorsWithFallback(ctx.Doer)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions services/dev/editor.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ func GetEditorsByNames(names []string) []*Editor {
}

// GetEditors returns all editors
func GetEditors() ([]Editor, error) {
return defaultEditors, nil
func GetEditors() []Editor {
return defaultEditors
}

func DefaultEditorsNames() string {
Expand Down