summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorJustin Nuß <justin.nuss@hmmh.de>2014-07-22 13:50:34 +0200
committerJustin Nuß <justin.nuss@hmmh.de>2014-07-22 13:50:34 +0200
commitec26b78d3cf1a72d0895ce37dc37b3f9cc3c11ea (patch)
tree675a5d9b33f7eb4f7bfa9ee34431691387715a1f /models
parent18718afb363dbc4bb2545a73936add5f152ffc09 (diff)
downloadgitea-ec26b78d3cf1a72d0895ce37dc37b3f9cc3c11ea.tar.gz
gitea-ec26b78d3cf1a72d0895ce37dc37b3f9cc3c11ea.zip
Fix issue #280. Update milestone counter when creating an issue
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.