diff options
author | Lauris BH <lauris@nix.lv> | 2023-03-02 01:44:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-02 01:44:23 +0200 |
commit | 58b414380371a4419f909491700673d43ae6b4ff (patch) | |
tree | 9d994ac5afecdf2109fe93d9ba97a12c201bd27e /routers/web/org | |
parent | de6c718b46ebd3b7f6362c766eed328044d95ec7 (diff) | |
download | gitea-58b414380371a4419f909491700673d43ae6b4ff.tar.gz gitea-58b414380371a4419f909491700673d43ae6b4ff.zip |
Add loading yaml label template files (#22976)
Extract from #11669 and enhancement to #22585 to support exclusive
scoped labels in label templates
* Move label template functionality to label module
* Fix handling of color codes
* Add Advanced label template
Diffstat (limited to 'routers/web/org')
-rw-r--r-- | routers/web/org/org_labels.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/routers/web/org/org_labels.go b/routers/web/org/org_labels.go index e96627762b..9ce05680d7 100644 --- a/routers/web/org/org_labels.go +++ b/routers/web/org/org_labels.go @@ -9,6 +9,7 @@ import ( "code.gitea.io/gitea/models/db" issues_model "code.gitea.io/gitea/models/issues" "code.gitea.io/gitea/modules/context" + "code.gitea.io/gitea/modules/label" repo_module "code.gitea.io/gitea/modules/repository" "code.gitea.io/gitea/modules/web" "code.gitea.io/gitea/services/forms" @@ -103,8 +104,8 @@ func InitializeLabels(ctx *context.Context) { } 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 + if label.IsErrTemplateLoad(err) { + originalErr := err.(label.ErrTemplateLoad).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 |