summaryrefslogtreecommitdiffstats
path: root/routers/repo/issue.go
diff options
context:
space:
mode:
authorJustin Nuß <justin.nuss@hmmh.de>2014-07-23 13:48:06 +0200
committerJustin Nuß <justin.nuss@hmmh.de>2014-07-23 13:48:06 +0200
commit469cbc881340dd3c31d4eeb3eb07ee805308a246 (patch)
tree65d3b8ee6542752a226ce616a703520e9c2d69fb /routers/repo/issue.go
parent6e9f1c52b18f112eecd5c72e295cfea1809f07fa (diff)
downloadgitea-469cbc881340dd3c31d4eeb3eb07ee805308a246.tar.gz
gitea-469cbc881340dd3c31d4eeb3eb07ee805308a246.zip
Update progress of milestones when closing/reopening issues and allow closing of issues in commit messages
Diffstat (limited to 'routers/repo/issue.go')
-rw-r--r--routers/repo/issue.go20
1 files changed, 2 insertions, 18 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go
index e71c835fd8..dbeb886bc5 100644
--- a/routers/repo/issue.go
+++ b/routers/repo/issue.go
@@ -644,24 +644,8 @@ func Comment(ctx *middleware.Context, params martini.Params) {
// Change open/closed issue counter for the associated milestone
if issue.MilestoneId > 0 {
- l, err := models.GetMilestoneById(issue.MilestoneId)
-
- if err != nil {
- ctx.Handle(500, "issue.Comment(GetLabelById)", err)
- return
- }
-
- if issue.IsClosed {
- l.NumOpenIssues = l.NumOpenIssues - 1
- l.NumClosedIssues = l.NumClosedIssues + 1
- } else {
- l.NumOpenIssues = l.NumOpenIssues + 1
- l.NumClosedIssues = l.NumClosedIssues - 1
- }
-
- if err = models.UpdateMilestone(l); err != nil {
- ctx.Handle(500, "issue.Comment(UpdateLabel)", err)
- return
+ if err = models.ChangeMilestoneIssueStats(issue); err != nil {
+ ctx.Handle(500, "issue.Comment(ChangeMilestoneIssueStats)", err)
}
}