Skip to content

Commit f066bd2

Browse files
zeripathtechknowlogick
authored andcommitted
Prevent double-close of issues (#6233)
1 parent 1986269 commit f066bd2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

models/issue.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,8 +699,14 @@ func UpdateIssueCols(issue *Issue, cols ...string) error {
699699
}
700700

701701
func (issue *Issue) changeStatus(e *xorm.Session, doer *User, isClosed bool) (err error) {
702+
// Reload the issue
703+
currentIssue, err := getIssueByID(e, issue.ID)
704+
if err != nil {
705+
return err
706+
}
707+
702708
// Nothing should be performed if current status is same as target status
703-
if issue.IsClosed == isClosed {
709+
if currentIssue.IsClosed == isClosed {
704710
return nil
705711
}
706712

0 commit comments

Comments
 (0)