Update progress of milestones when closing/reopening issues and allow closing of issues in commit messages
This commit is contained in:
parent
6e9f1c52b1
commit
469cbc8813
4 changed files with 155 additions and 24 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue