diff options
Diffstat (limited to 'models/issues/issue_project.go')
-rw-r--r-- | models/issues/issue_project.go | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/models/issues/issue_project.go b/models/issues/issue_project.go index 5e0a337f7d..b83665c2bb 100644 --- a/models/issues/issue_project.go +++ b/models/issues/issue_project.go @@ -14,32 +14,32 @@ import ( ) // LoadProject load the project the issue was assigned to -func (i *Issue) LoadProject() (err error) { - return i.loadProject(db.DefaultContext) +func (issue *Issue) LoadProject() (err error) { + return issue.loadProject(db.DefaultContext) } -func (i *Issue) loadProject(ctx context.Context) (err error) { - if i.Project == nil { +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"). Join("INNER", "project_issue", "project.id=project_issue.project_id"). - Where("project_issue.issue_id = ?", i.ID). + Where("project_issue.issue_id = ?", issue.ID). Get(&p); err != nil { return err } - i.Project = &p + issue.Project = &p } - return + return err } // ProjectID return project id if issue was assigned to one -func (i *Issue) ProjectID() int64 { - return i.projectID(db.DefaultContext) +func (issue *Issue) ProjectID() int64 { + return issue.projectID(db.DefaultContext) } -func (i *Issue) projectID(ctx context.Context) int64 { +func (issue *Issue) projectID(ctx context.Context) int64 { var ip project_model.ProjectIssue - has, err := db.GetEngine(ctx).Where("issue_id=?", i.ID).Get(&ip) + has, err := db.GetEngine(ctx).Where("issue_id=?", issue.ID).Get(&ip) if err != nil || !has { return 0 } @@ -47,13 +47,13 @@ func (i *Issue) projectID(ctx context.Context) int64 { } // ProjectBoardID return project board id if issue was assigned to one -func (i *Issue) ProjectBoardID() int64 { - return i.projectBoardID(db.DefaultContext) +func (issue *Issue) ProjectBoardID() int64 { + return issue.projectBoardID(db.DefaultContext) } -func (i *Issue) projectBoardID(ctx context.Context) int64 { +func (issue *Issue) projectBoardID(ctx context.Context) int64 { var ip project_model.ProjectIssue - has, err := db.GetEngine(ctx).Where("issue_id=?", i.ID).Get(&ip) + has, err := db.GetEngine(ctx).Where("issue_id=?", issue.ID).Get(&ip) if err != nil || !has { return 0 } |