From f066bd2b3f53ff044caefdd1bf3e2a82fa76a20e Mon Sep 17 00:00:00 2001 From: zeripath Date: Tue, 5 Mar 2019 02:52:52 +0000 Subject: [PATCH] Prevent double-close of issues (#6233) --- models/issue.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/models/issue.go b/models/issue.go index 503ff32b8ea..396c029d460 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 }