summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorGiteabot <teabot@gitea.io>2023-06-25 22:06:58 -0400
committerGitHub <noreply@github.com>2023-06-26 02:06:58 +0000
commit9bbb4d8d6d812d395d16d9a60ae55338608df73d (patch)
treea3acf52cfad864cc6d9b711ede88bf05f11c2fa2 /routers
parent5703a0d3e310667ff77f429991c3c7ae93eb48f3 (diff)
downloadgitea-9bbb4d8d6d812d395d16d9a60ae55338608df73d.tar.gz
gitea-9bbb4d8d6d812d395d16d9a60ae55338608df73d.zip
Improve loadprojects for issue list (#25468) (#25493)
Diffstat (limited to 'routers')
-rw-r--r--routers/web/org/projects.go9
-rw-r--r--routers/web/repo/issue.go4
-rw-r--r--routers/web/repo/projects.go7
3 files changed, 15 insertions, 5 deletions
diff --git a/routers/web/org/projects.go b/routers/web/org/projects.go
index b3f6024b60..e525f2c43f 100644
--- a/routers/web/org/projects.go
+++ b/routers/web/org/projects.go
@@ -383,7 +383,7 @@ func ViewProject(ctx *context.Context) {
ctx.HTML(http.StatusOK, tplProjectsView)
}
-func getActionIssues(ctx *context.Context) []*issues_model.Issue {
+func getActionIssues(ctx *context.Context) issues_model.IssueList {
commaSeparatedIssueIDs := ctx.FormString("issue_ids")
if len(commaSeparatedIssueIDs) == 0 {
return nil
@@ -429,9 +429,14 @@ func UpdateIssueProject(ctx *context.Context) {
return
}
+ if err := issues.LoadProjects(ctx); err != nil {
+ ctx.ServerError("LoadProjects", err)
+ return
+ }
+
projectID := ctx.FormInt64("id")
for _, issue := range issues {
- oldProjectID := issue.ProjectID()
+ oldProjectID := issue.Project.ID
if oldProjectID == projectID {
continue
}
diff --git a/routers/web/repo/issue.go b/routers/web/repo/issue.go
index 5ab8db2e05..0756fcd533 100644
--- a/routers/web/repo/issue.go
+++ b/routers/web/repo/issue.go
@@ -1971,7 +1971,7 @@ func checkIssueRights(ctx *context.Context, issue *issues_model.Issue) {
}
}
-func getActionIssues(ctx *context.Context) []*issues_model.Issue {
+func getActionIssues(ctx *context.Context) issues_model.IssueList {
commaSeparatedIssueIDs := ctx.FormString("issue_ids")
if len(commaSeparatedIssueIDs) == 0 {
return nil
@@ -2722,7 +2722,7 @@ func UpdateIssueStatus(ctx *context.Context) {
log.Warn("Unrecognized action: %s", action)
}
- if _, err := issues_model.IssueList(issues).LoadRepositories(ctx); err != nil {
+ if _, err := issues.LoadRepositories(ctx); err != nil {
ctx.ServerError("LoadRepositories", err)
return
}
diff --git a/routers/web/repo/projects.go b/routers/web/repo/projects.go
index 5ee5ead121..6da9edfd0b 100644
--- a/routers/web/repo/projects.go
+++ b/routers/web/repo/projects.go
@@ -378,9 +378,14 @@ func UpdateIssueProject(ctx *context.Context) {
return
}
+ if err := issues.LoadProjects(ctx); err != nil {
+ ctx.ServerError("LoadProjects", err)
+ return
+ }
+
projectID := ctx.FormInt64("id")
for _, issue := range issues {
- oldProjectID := issue.ProjectID()
+ oldProjectID := issue.Project.ID
if oldProjectID == projectID {
continue
}