webhook: only trigger specific webhook for test delivery (#3030)

This commit is contained in:
Unknwon
2017-02-21 15:44:35 -05:00
parent 0f3155660e
commit bd970b8b27
5 changed files with 41 additions and 28 deletions

View File

@@ -99,7 +99,7 @@ func CreateHook(ctx *context.APIContext, form api.CreateHookOption) {
// https://github.com/gogits/go-gogs-client/wiki/Repositories#edit-a-hook
func EditHook(ctx *context.APIContext, form api.EditHookOption) {
w, err := models.GetWebhookByRepoID(ctx.Repo.Repository.ID, ctx.ParamsInt64(":id"))
w, err := models.GetWebhookOfRepoByID(ctx.Repo.Repository.ID, ctx.ParamsInt64(":id"))
if err != nil {
if models.IsErrWebhookNotExist(err) {
ctx.Status(404)