mirror of
https://github.com/go-gitea/gitea
synced 2025-08-10 11:38:20 +00:00
Fix close issue but time watcher still running (#17761)
* Fix bug * Update models/issue_stopwatch.go Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: zeripath <art27@cantab.net>
This commit is contained in:
@@ -13,7 +13,19 @@ import (
|
||||
func ChangeStatus(issue *models.Issue, doer *models.User, isClosed bool) (err error) {
|
||||
comment, err := issue.ChangeStatus(doer, isClosed)
|
||||
if err != nil {
|
||||
return
|
||||
// Don't return an error when dependencies are open as this would let the push fail
|
||||
if models.IsErrDependenciesLeft(err) {
|
||||
if isClosed {
|
||||
return models.FinishIssueStopwatchIfPossible(doer, issue)
|
||||
}
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
if isClosed {
|
||||
if err := models.FinishIssueStopwatchIfPossible(doer, issue); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
notification.NotifyIssueChangeStatus(doer, issue, comment, isClosed)
|
||||
|
Reference in New Issue
Block a user