summaryrefslogtreecommitdiffstats
path: root/models/issue.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2019-10-07 05:26:19 +0800
committertechknowlogick <techknowlogick@gitea.io>2019-10-06 17:26:19 -0400
commit51fade4c44c3517923cd07783ab05a55aaa84dcd (patch)
tree8f7b745489bd677a74a779c273cc786b0f479900 /models/issue.go
parentbc5a479fefa77ee54a9fddecdbbb7e7991f22da1 (diff)
downloadgitea-51fade4c44c3517923cd07783ab05a55aaa84dcd.tar.gz
gitea-51fade4c44c3517923cd07783ab05a55aaa84dcd.zip
Fix milestone num_issues (#8221)
* fix milestone num_issues * update missing completeness * only update milestone closed number when closed issue is assigned a new milestone or clear milestone * fix tests * fix update milestone num * fix completeness calculate * make completeness calucation more clear
Diffstat (limited to 'models/issue.go')
-rw-r--r--models/issue.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/models/issue.go b/models/issue.go
index 9590bc04ff..e4cc1291c2 100644
--- a/models/issue.go
+++ b/models/issue.go
@@ -766,7 +766,7 @@ func (issue *Issue) changeStatus(e *xorm.Session, doer *User, isClosed bool) (er
}
// Update issue count of milestone
- if err = changeMilestoneIssueStats(e, issue); err != nil {
+ if err := updateMilestoneClosedNum(e, issue.MilestoneID); err != nil {
return err
}
@@ -1119,7 +1119,7 @@ func newIssue(e *xorm.Session, doer *User, opts NewIssueOptions) (err error) {
opts.Issue.Index = inserted.Index
if opts.Issue.MilestoneID > 0 {
- if err = changeMilestoneAssign(e, doer, opts.Issue, -1); err != nil {
+ if _, err = e.Exec("UPDATE `milestone` SET num_issues=num_issues+1 WHERE id=?", opts.Issue.MilestoneID); err != nil {
return err
}
}