mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-31 20:02:09 +00:00
parent
c6b3c5bcef
commit
67b316a954
16 changed files with 144 additions and 45 deletions
|
@ -31,7 +31,7 @@ func getIssueFromRef(repo *models.Repository, index int64) (*models.Issue, error
|
|||
return issue, nil
|
||||
}
|
||||
|
||||
func changeIssueStatus(repo *models.Repository, issue *models.Issue, doer *models.User, status bool) error {
|
||||
func changeIssueStatus(repo *models.Repository, issue *models.Issue, doer *models.User, closed bool) error {
|
||||
stopTimerIfAvailable := func(doer *models.User, issue *models.Issue) error {
|
||||
|
||||
if models.StopwatchExists(doer.ID, issue.ID) {
|
||||
|
@ -44,7 +44,8 @@ func changeIssueStatus(repo *models.Repository, issue *models.Issue, doer *model
|
|||
}
|
||||
|
||||
issue.Repo = repo
|
||||
if err := issue.ChangeStatus(doer, status); err != nil {
|
||||
comment, err := issue.ChangeStatus(doer, closed)
|
||||
if err != nil {
|
||||
// Don't return an error when dependencies are open as this would let the push fail
|
||||
if models.IsErrDependenciesLeft(err) {
|
||||
return stopTimerIfAvailable(doer, issue)
|
||||
|
@ -52,6 +53,8 @@ func changeIssueStatus(repo *models.Repository, issue *models.Issue, doer *model
|
|||
return err
|
||||
}
|
||||
|
||||
notification.NotifyIssueChangeStatus(doer, issue, comment, closed)
|
||||
|
||||
return stopTimerIfAvailable(doer, issue)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue