summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2020-12-10 01:20:13 +0800
committerGitHub <noreply@github.com>2020-12-09 17:20:13 +0000
commit6edfa6bc88ed73fc5a31f1b2fe9f5587c932ada7 (patch)
treee6c479d97cbd006c3cc521ec77fde5c0d72b4cc1 /services
parent18e4477ad41a8733225d3c92eea5b91c12af1a94 (diff)
downloadgitea-6edfa6bc88ed73fc5a31f1b2fe9f5587c932ada7.tar.gz
gitea-6edfa6bc88ed73fc5a31f1b2fe9f5587c932ada7.zip
Fix broken migration on webhook (#13911)
* Fix broken migration on webhook * Fix lint Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Diffstat (limited to 'services')
-rw-r--r--services/webhook/webhook.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/services/webhook/webhook.go b/services/webhook/webhook.go
index 104ea3f8b2..88dec6bd40 100644
--- a/services/webhook/webhook.go
+++ b/services/webhook/webhook.go
@@ -128,7 +128,7 @@ func prepareWebhook(w *models.Webhook, repo *models.Repository, event models.Hoo
// Avoid sending "0 new commits" to non-integration relevant webhooks (e.g. slack, discord, etc.).
// Integration webhooks (e.g. drone) still receive the required data.
if pushEvent, ok := p.(*api.PushPayload); ok &&
- w.HookTaskType != models.GITEA && w.HookTaskType != models.GOGS &&
+ w.Type != models.GITEA && w.Type != models.GOGS &&
len(pushEvent.Commits) == 0 {
return nil
}
@@ -144,11 +144,11 @@ func prepareWebhook(w *models.Webhook, repo *models.Repository, event models.Hoo
var payloader api.Payloader
var err error
- webhook, ok := webhooks[w.HookTaskType]
+ webhook, ok := webhooks[w.Type]
if ok {
payloader, err = webhook.payloadCreator(p, event, w.Meta)
if err != nil {
- return fmt.Errorf("create payload for %s[%s]: %v", w.HookTaskType, event, err)
+ return fmt.Errorf("create payload for %s[%s]: %v", w.Type, event, err)
}
} else {
p.SetSecret(w.Secret)
@@ -172,7 +172,7 @@ func prepareWebhook(w *models.Webhook, repo *models.Repository, event models.Hoo
if err = models.CreateHookTask(&models.HookTask{
RepoID: repo.ID,
HookID: w.ID,
- Typ: w.HookTaskType,
+ Typ: w.Type,
URL: w.URL,
Signature: signature,
Payloader: payloader,