summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
author无闻 <joe2010xtmf@163.com>2014-07-22 16:03:58 -0400
committer无闻 <joe2010xtmf@163.com>2014-07-22 16:03:58 -0400
commitdc2e1403603789e438ced9ac7dceb736d70f426c (patch)
tree9f27b9fb3907ef0bdb2f2c1a779776fcb37fd1cc /models
parent5bbd5be0caf35f23de833f765e2eeb0e5772fbf3 (diff)
parentec26b78d3cf1a72d0895ce37dc37b3f9cc3c11ea (diff)
downloadgitea-dc2e1403603789e438ced9ac7dceb736d70f426c.tar.gz
gitea-dc2e1403603789e438ced9ac7dceb736d70f426c.zip
Merge pull request #296 from nuss-justin/dev
Fix issue 280 & unwatch button in Firefox
Diffstat (limited to 'models')
-rw-r--r--models/issue.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/models/issue.go b/models/issue.go
index baf710a5ee..c370af363e 100644
--- a/models/issue.go
+++ b/models/issue.go
@@ -108,7 +108,17 @@ func NewIssue(issue *Issue) (err error) {
sess.Rollback()
return err
}
- return sess.Commit()
+
+ if err = sess.Commit(); err != nil {
+ return err
+ }
+
+ if issue.MilestoneId > 0 {
+ // FIXES(280): Update milestone counter.
+ return ChangeMilestoneAssign(0, issue.MilestoneId, issue)
+ }
+
+ return
}
// GetIssueByIndex returns issue by given index in repository.