aboutsummaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2019-03-05 02:52:52 +0000
committertechknowlogick <matti@mdranta.net>2019-03-04 21:52:52 -0500
commitf066bd2b3f53ff044caefdd1bf3e2a82fa76a20e (patch)
tree77ed44138ced1d881a446903f93b5dae1e49689e /models
parent19862699cd4fcac672cf87310b192d3182357086 (diff)
downloadgitea-f066bd2b3f53ff044caefdd1bf3e2a82fa76a20e.tar.gz
gitea-f066bd2b3f53ff044caefdd1bf3e2a82fa76a20e.zip
Prevent double-close of issues (#6233)
Diffstat (limited to 'models')
-rw-r--r--models/issue.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/models/issue.go b/models/issue.go
index 503ff32b8e..396c029d46 100644
--- a/models/issue.go
+++ b/models/issue.go
@@ -699,8 +699,14 @@ func UpdateIssueCols(issue *Issue, cols ...string) error {
}
func (issue *Issue) changeStatus(e *xorm.Session, doer *User, isClosed bool) (err error) {
+ // Reload the issue
+ currentIssue, err := getIssueByID(e, issue.ID)
+ if err != nil {
+ return err
+ }
+
// Nothing should be performed if current status is same as target status
- if issue.IsClosed == isClosed {
+ if currentIssue.IsClosed == isClosed {
return nil
}