From f4ce8c73fbeadb84daba8c8c68f46f911339b8f8 Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Tue, 21 Feb 2023 04:21:56 +0900 Subject: [PATCH] Improve issues.LoadProject (#22982) issues.LoadProject() is no use change `issues.loadProject(ctx)` to issues.LoadProject(ctx) --- models/issues/issue.go | 2 +- models/issues/issue_project.go | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/models/issues/issue.go b/models/issues/issue.go index 9d7dea01772c..6c76909fcfd8 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 c9f4c9f5336b..04d12e055cc5 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").