summaryrefslogtreecommitdiffstats
path: root/routers/web/repo/projects.go
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 /routers/web/repo/projects.go
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 'routers/web/repo/projects.go')
-rw-r--r--routers/web/repo/projects.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/routers/web/repo/projects.go b/routers/web/repo/projects.go
index c1805944db..51c891dbf0 100644
--- a/routers/web/repo/projects.go
+++ b/routers/web/repo/projects.go
@@ -10,7 +10,7 @@ import (
"net/url"
"strings"
- "code.gitea.io/gitea/models"
+ issues_model "code.gitea.io/gitea/models/issues"
"code.gitea.io/gitea/models/perm"
project_model "code.gitea.io/gitea/models/project"
"code.gitea.io/gitea/models/unit"
@@ -296,13 +296,13 @@ func ViewProject(ctx *context.Context) {
boards[0].Title = ctx.Tr("repo.projects.type.uncategorized")
}
- issuesMap, err := models.LoadIssuesFromBoardList(boards)
+ issuesMap, err := issues_model.LoadIssuesFromBoardList(boards)
if err != nil {
ctx.ServerError("LoadIssuesOfBoards", err)
return
}
- linkedPrsMap := make(map[int64][]*models.Issue)
+ linkedPrsMap := make(map[int64][]*issues_model.Issue)
for _, issuesList := range issuesMap {
for _, issue := range issuesList {
var referencedIds []int64
@@ -313,7 +313,7 @@ func ViewProject(ctx *context.Context) {
}
if len(referencedIds) > 0 {
- if linkedPrs, err := models.Issues(&models.IssuesOptions{
+ if linkedPrs, err := issues_model.Issues(&issues_model.IssuesOptions{
IssueIDs: referencedIds,
IsPull: util.OptionalBoolTrue,
}); err == nil {
@@ -358,7 +358,7 @@ func UpdateIssueProject(ctx *context.Context) {
continue
}
- if err := models.ChangeProjectAssign(issue, ctx.Doer, projectID); err != nil {
+ if err := issues_model.ChangeProjectAssign(issue, ctx.Doer, projectID); err != nil {
ctx.ServerError("ChangeProjectAssign", err)
return
}
@@ -622,9 +622,9 @@ func MoveIssues(ctx *context.Context) {
issueIDs = append(issueIDs, issue.IssueID)
sortedIssueIDs[issue.Sorting] = issue.IssueID
}
- movedIssues, err := models.GetIssuesByIDs(ctx, issueIDs)
+ movedIssues, err := issues_model.GetIssuesByIDs(ctx, issueIDs)
if err != nil {
- if models.IsErrIssueNotExist(err) {
+ if issues_model.IsErrIssueNotExist(err) {
ctx.NotFound("IssueNotExisting", nil)
} else {
ctx.ServerError("GetIssueByID", err)