mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-20 17:57:14 -04:00
models/webhook: restrict deletion to be explicitly with repo and org ID
This commit is contained in:
parent
5ff2dfb23e
commit
60110adc06
7 changed files with 55 additions and 48 deletions
|
@ -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"))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue