diff --git a/models/project_issue.go b/models/project_issue.go index a3179507dc9..4e3bc0039d2 100644 --- a/models/project_issue.go +++ b/models/project_issue.go @@ -121,7 +121,9 @@ func (p *Project) NumClosedIssues() int { func (p *Project) NumOpenIssues() int { c, err := db.GetEngine(db.DefaultContext).Table("project_issue"). Join("INNER", "issue", "project_issue.issue_id=issue.id"). - Where("project_issue.project_id=? AND issue.is_closed=?", p.ID, false).Count("issue.id") + Where("project_issue.project_id=? AND issue.is_closed=?", p.ID, false). + Cols("issue_id"). + Count() if err != nil { return 0 }