diff options
Diffstat (limited to 'routers/repo/webhook.go')
-rw-r--r-- | routers/repo/webhook.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/routers/repo/webhook.go b/routers/repo/webhook.go index f033e41b..542fa635 100644 --- a/routers/repo/webhook.go +++ b/routers/repo/webhook.go @@ -273,7 +273,7 @@ func checkWebhook(ctx *context.Context) (*OrgRepoCtx, *models.Webhook) { var w *models.Webhook if orCtx.RepoID > 0 { - w, err = models.GetWebhookByRepoID(ctx.Repo.Repository.ID, ctx.ParamsInt64(":id")) + w, err = models.GetWebhookOfRepoByID(ctx.Repo.Repository.ID, ctx.ParamsInt64(":id")) } else { w, err = models.GetWebhookByOrgID(ctx.Org.Organization.ID, ctx.ParamsInt64(":id")) } @@ -504,8 +504,8 @@ func TestWebhook(ctx *context.Context) { Pusher: apiUser, Sender: apiUser, } - if err := models.PrepareWebhooks(ctx.Repo.Repository, models.HOOK_EVENT_PUSH, p); err != nil { - ctx.Flash.Error("PrepareWebhooks: " + err.Error()) + if err := models.TestWebhook(ctx.Repo.Repository, models.HOOK_EVENT_PUSH, p, ctx.QueryInt64("id")); err != nil { + ctx.Flash.Error("TestWebhook: " + err.Error()) ctx.Status(500) } else { go models.HookQueue.Add(ctx.Repo.Repository.ID) |