diff options
author | Justin Nuß <justin.nuss@hmmh.de> | 2014-07-22 13:50:34 +0200 |
---|---|---|
committer | Justin Nuß <justin.nuss@hmmh.de> | 2014-07-22 13:50:34 +0200 |
commit | ec26b78d3cf1a72d0895ce37dc37b3f9cc3c11ea (patch) | |
tree | 675a5d9b33f7eb4f7bfa9ee34431691387715a1f /models | |
parent | 18718afb363dbc4bb2545a73936add5f152ffc09 (diff) | |
download | gitea-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.go | 12 |
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. |