diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-10-28 13:26:46 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-28 13:26:46 +0800 |
commit | c66c9dabc7453febc0e01fcc974baf06fd96c38d (patch) | |
tree | 59709b9bd6c68cf4efaa5ed9b34a30cbde99d462 /models/issue.go | |
parent | 495d5e4329326b27158a25b44c37986923d0bb6b (diff) | |
download | gitea-c66c9dabc7453febc0e01fcc974baf06fd96c38d.tar.gz gitea-c66c9dabc7453febc0e01fcc974baf06fd96c38d.zip |
Move issue change status from models to service (#8691)
Diffstat (limited to 'models/issue.go')
-rw-r--r-- | models/issue.go | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/models/issue.go b/models/issue.go index 0315580c31..b4bd190aa4 100644 --- a/models/issue.go +++ b/models/issue.go @@ -674,45 +674,6 @@ func (issue *Issue) ChangeStatus(doer *User, isClosed bool) (err error) { if err = sess.Commit(); err != nil { return fmt.Errorf("Commit: %v", err) } - sess.Close() - - mode, _ := AccessLevel(issue.Poster, issue.Repo) - if issue.IsPull { - if err = issue.loadPullRequest(sess); err != nil { - return err - } - // Merge pull request calls issue.changeStatus so we need to handle separately. - apiPullRequest := &api.PullRequestPayload{ - Index: issue.Index, - PullRequest: issue.PullRequest.APIFormat(), - Repository: issue.Repo.APIFormat(mode), - Sender: doer.APIFormat(), - } - if isClosed { - apiPullRequest.Action = api.HookIssueClosed - } else { - apiPullRequest.Action = api.HookIssueReOpened - } - err = PrepareWebhooks(issue.Repo, HookEventPullRequest, apiPullRequest) - } else { - apiIssue := &api.IssuePayload{ - Index: issue.Index, - Issue: issue.APIFormat(), - Repository: issue.Repo.APIFormat(mode), - Sender: doer.APIFormat(), - } - if isClosed { - apiIssue.Action = api.HookIssueClosed - } else { - apiIssue.Action = api.HookIssueReOpened - } - err = PrepareWebhooks(issue.Repo, HookEventIssues, apiIssue) - } - if err != nil { - log.Error("PrepareWebhooks [is_pull: %v, is_closed: %v]: %v", issue.IsPull, isClosed, err) - } else { - go HookQueue.Add(issue.Repo.ID) - } return nil } |