aboutsummaryrefslogtreecommitdiffstats
path: root/modules/repository
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2022-06-13 17:37:59 +0800
committerGitHub <noreply@github.com>2022-06-13 17:37:59 +0800
commit1a9821f57a0293db3adc0eab8aff08ca5fa1026c (patch)
tree3c3d02813eb63c0d0827ef6d9745f6dcdd2636cb /modules/repository
parent3708ca8e2849ca7e36e6bd15ec6935a2a2d81e55 (diff)
downloadgitea-1a9821f57a0293db3adc0eab8aff08ca5fa1026c.tar.gz
gitea-1a9821f57a0293db3adc0eab8aff08ca5fa1026c.zip
Move issues related files into models/issues (#19931)
* Move access and repo permission to models/perm/access * fix test * fix git test * Move functions sequence * Some improvements per @KN4CK3R and @delvh * Move issues related code to models/issues * Move some issues related sub package * Merge * Fix test * Fix test * Fix test * Fix test * Rename some files
Diffstat (limited to 'modules/repository')
-rw-r--r--modules/repository/init.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/modules/repository/init.go b/modules/repository/init.go
index 285fe81dbe..f5cef3301d 100644
--- a/modules/repository/init.go
+++ b/modules/repository/init.go
@@ -16,6 +16,7 @@ import (
"time"
"code.gitea.io/gitea/models"
+ issues_model "code.gitea.io/gitea/models/issues"
repo_model "code.gitea.io/gitea/models/repo"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/git"
@@ -113,7 +114,7 @@ func GetLabelTemplateFile(name string) ([][3]string, error) {
if len(color) == 6 {
color = "#" + color
}
- if !models.LabelColorPattern.MatchString(color) {
+ if !issues_model.LabelColorPattern.MatchString(color) {
return nil, ErrIssueLabelTemplateLoad{name, fmt.Errorf("bad HTML color code in line: %s", line)}
}
@@ -453,9 +454,9 @@ func InitializeLabels(ctx context.Context, id int64, labelTemplate string, isOrg
return err
}
- labels := make([]*models.Label, len(list))
+ labels := make([]*issues_model.Label, len(list))
for i := 0; i < len(list); i++ {
- labels[i] = &models.Label{
+ labels[i] = &issues_model.Label{
Name: list[i][0],
Description: list[i][2],
Color: list[i][1],
@@ -467,7 +468,7 @@ func InitializeLabels(ctx context.Context, id int64, labelTemplate string, isOrg
}
}
for _, label := range labels {
- if err = models.NewLabel(ctx, label); err != nil {
+ if err = issues_model.NewLabel(ctx, label); err != nil {
return err
}
}