1
0
Fork 0
forked from forgejo/forgejo

Make label templates have consistent behavior and priority (#23749) (#24071)

Backport #23749

Fix https://github.com/go-gitea/gitea/issues/23715

Backported manually and tested manually.
This commit is contained in:
wxiaoguang 2023-04-12 22:05:10 +08:00 committed by GitHub
parent 5482602ba8
commit d562b419b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 135 additions and 89 deletions

View file

@ -23,7 +23,6 @@ import (
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/models/webhook"
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/label"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
api "code.gitea.io/gitea/modules/structs"
@ -190,7 +189,7 @@ func CreateRepository(doer, u *user_model.User, opts CreateRepoOptions) (*repo_m
// Check if label template exist
if len(opts.IssueLabels) > 0 {
if _, err := label.GetTemplateFile(opts.IssueLabels); err != nil {
if _, err := LoadTemplateLabelsByDisplayName(opts.IssueLabels); err != nil {
return nil, err
}
}