mirror of
https://github.com/go-gitea/gitea
synced 2025-07-03 09:07:19 +00:00
models/webhook: restrict deletion to be explicitly with repo and org ID
This commit is contained in:
@ -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"))
|
||||
}
|
||||
|
Reference in New Issue
Block a user