Skip to content

Commit

Permalink
Prevent double-close of issues (go-gitea#6233)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeripath authored and techknowlogick committed Mar 5, 2019
1 parent 1986269 commit f066bd2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion models/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit f066bd2

Please sign in to comment.