aboutsummaryrefslogtreecommitdiffstats
path: root/routers/repo/webhook.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-07-17 08:33:59 +0800
committerUnknwon <u@gogs.io>2016-07-17 08:33:59 +0800
commit60110adc06ef85e533f48a52a744d43c63a818bc (patch)
tree722f5adcf7a2269563f0e9c2ed415449a607cbfb /routers/repo/webhook.go
parent5ff2dfb23eb4f5c436d69cc86945192eb4b3d279 (diff)
downloadgitea-60110adc06ef85e533f48a52a744d43c63a818bc.tar.gz
gitea-60110adc06ef85e533f48a52a744d43c63a818bc.zip
models/webhook: restrict deletion to be explicitly with repo and org ID
Diffstat (limited to 'routers/repo/webhook.go')
-rw-r--r--routers/repo/webhook.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/routers/repo/webhook.go b/routers/repo/webhook.go
index b2274033b0..22d5cfd2c6 100644
--- a/routers/repo/webhook.go
+++ b/routers/repo/webhook.go
@@ -384,8 +384,8 @@ func TestWebhook(ctx *context.Context) {
}
func DeleteWebhook(ctx *context.Context) {
- if err := models.DeleteWebhook(ctx.QueryInt64("id")); err != nil {
- ctx.Flash.Error("DeleteWebhook: " + err.Error())
+ if err := models.DeleteWebhookByRepoID(ctx.Repo.Repository.ID, ctx.QueryInt64("id")); err != nil {
+ ctx.Flash.Error("DeleteWebhookByRepoID: " + err.Error())
} else {
ctx.Flash.Success(ctx.Tr("repo.settings.webhook_deletion_success"))
}