瀏覽代碼

Fix PR-webhook issue where Label-data is stale (#3486) (#3510)

* Fix PR-webhook issue where Label-data is stale

* Conventions \o/

* logs are nice if they're consistent...
tags/v0.9.99
Kim "BKC" Carlbäcker 7 年之前
父節點
當前提交
06602a84ff
共有 1 個檔案被更改,包括 10 行新增2 行删除
  1. 10
    2
      models/issue.go

+ 10
- 2
models/issue.go 查看文件

@@ -235,7 +235,11 @@ func (i *Issue) HasLabel(labelID int64) bool {
func (issue *Issue) sendLabelUpdatedWebhook(doer *User) {
var err error
if issue.IsPull {
issue.PullRequest.Issue = issue
err = issue.PullRequest.LoadIssue()
if err != nil {
log.Error(4, "LoadIssue: %v", err)
return
}
err = PrepareWebhooks(issue.Repo, HOOK_EVENT_PULL_REQUEST, &api.PullRequestPayload{
Action: api.HOOK_ISSUE_LABEL_UPDATED,
Index: issue.Index,
@@ -335,7 +339,11 @@ func (issue *Issue) ClearLabels(doer *User) (err error) {
}

if issue.IsPull {
issue.PullRequest.Issue = issue
err = issue.PullRequest.LoadIssue()
if err != nil {
log.Error(4, "LoadIssue: %v", err)
return
}
err = PrepareWebhooks(issue.Repo, HOOK_EVENT_PULL_REQUEST, &api.PullRequestPayload{
Action: api.HOOK_ISSUE_LABEL_CLEARED,
Index: issue.Index,

Loading…
取消
儲存