1
1
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:
Lunny Xiao
2021-11-23 20:05:44 +08:00
committed by GitHub
parent a08856606e
commit 714ecd9f1e
6 changed files with 153 additions and 96 deletions

View File

@@ -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)