aboutsummaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authoryp05327 <576951401@qq.com>2023-02-21 04:21:56 +0900
committerGitHub <noreply@github.com>2023-02-20 13:21:56 -0600
commitf4ce8c73fbeadb84daba8c8c68f46f911339b8f8 (patch)
treeff1165f7185b78b7932f4ea408ccca71272adffd /models
parentcfc7a4efdb7f4654a6d916b10ac8efa73ad6c30c (diff)
downloadgitea-f4ce8c73fbeadb84daba8c8c68f46f911339b8f8.tar.gz
gitea-f4ce8c73fbeadb84daba8c8c68f46f911339b8f8.zip
Improve issues.LoadProject (#22982)
issues.LoadProject() is no use change `issues.loadProject(ctx)` to issues.LoadProject(ctx)
Diffstat (limited to 'models')
-rw-r--r--models/issues/issue.go2
-rw-r--r--models/issues/issue_project.go6
2 files changed, 2 insertions, 6 deletions
diff --git a/models/issues/issue.go b/models/issues/issue.go
index 9d7dea0177..6c76909fcf 100644
--- a/models/issues/issue.go
+++ b/models/issues/issue.go
@@ -347,7 +347,7 @@ func (issue *Issue) LoadAttributes(ctx context.Context) (err error) {
return
}
- if err = issue.loadProject(ctx); err != nil {
+ if err = issue.LoadProject(ctx); err != nil {
return
}
diff --git a/models/issues/issue_project.go b/models/issues/issue_project.go
index c9f4c9f533..04d12e055c 100644
--- a/models/issues/issue_project.go
+++ b/models/issues/issue_project.go
@@ -13,11 +13,7 @@ import (
)
// LoadProject load the project the issue was assigned to
-func (issue *Issue) LoadProject() (err error) {
- return issue.loadProject(db.DefaultContext)
-}
-
-func (issue *Issue) loadProject(ctx context.Context) (err error) {
+func (issue *Issue) LoadProject(ctx context.Context) (err error) {
if issue.Project == nil {
var p project_model.Project
if _, err = db.GetEngine(ctx).Table("project").