diff options
Diffstat (limited to 'routers/web/org')
-rw-r--r-- | routers/web/org/org_labels.go | 9 | ||||
-rw-r--r-- | routers/web/org/setting.go | 3 |
2 files changed, 7 insertions, 5 deletions
diff --git a/routers/web/org/org_labels.go b/routers/web/org/org_labels.go index 0ec6c3ce3b..d79ffc597c 100644 --- a/routers/web/org/org_labels.go +++ b/routers/web/org/org_labels.go @@ -10,6 +10,7 @@ import ( "code.gitea.io/gitea/models" "code.gitea.io/gitea/models/db" "code.gitea.io/gitea/modules/context" + repo_module "code.gitea.io/gitea/modules/repository" "code.gitea.io/gitea/modules/web" "code.gitea.io/gitea/services/forms" ) @@ -48,7 +49,7 @@ func NewLabel(ctx *context.Context) { Description: form.Description, Color: form.Color, } - if err := models.NewLabel(l); err != nil { + if err := models.NewLabel(ctx, l); err != nil { ctx.ServerError("NewLabel", err) return } @@ -100,9 +101,9 @@ func InitializeLabels(ctx *context.Context) { return } - if err := models.InitializeLabels(ctx, ctx.Org.Organization.ID, form.TemplateName, true); err != nil { - if models.IsErrIssueLabelTemplateLoad(err) { - originalErr := err.(models.ErrIssueLabelTemplateLoad).OriginalError + if err := repo_module.InitializeLabels(ctx, ctx.Org.Organization.ID, form.TemplateName, true); err != nil { + if repo_module.IsErrIssueLabelTemplateLoad(err) { + originalErr := err.(repo_module.ErrIssueLabelTemplateLoad).OriginalError ctx.Flash.Error(ctx.Tr("repo.issues.label_templates.fail_to_load_file", form.TemplateName, originalErr)) ctx.Redirect(ctx.Org.OrgLink + "/settings/labels") return diff --git a/routers/web/org/setting.go b/routers/web/org/setting.go index 72c25ec25d..7dd51b253b 100644 --- a/routers/web/org/setting.go +++ b/routers/web/org/setting.go @@ -18,6 +18,7 @@ import ( "code.gitea.io/gitea/modules/base" "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/log" + repo_module "code.gitea.io/gitea/modules/repository" "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/web" user_setting "code.gitea.io/gitea/routers/web/user/setting" @@ -232,6 +233,6 @@ func Labels(ctx *context.Context) { ctx.Data["PageIsOrgSettings"] = true ctx.Data["PageIsOrgSettingsLabels"] = true ctx.Data["RequireTribute"] = true - ctx.Data["LabelTemplates"] = models.LabelTemplates + ctx.Data["LabelTemplates"] = repo_module.LabelTemplates ctx.HTML(http.StatusOK, tplSettingsLabels) } |