mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-09-10 20:22:14 +02:00
Reenable creating default webhooks. (#24626)
Fixes #24624 This seems to have been broken in https://github.com/go-gitea/gitea/pull/21563 Previously, this code read ``` // Are we looking at default webhooks? if ctx.Params(":configType") == "default-hooks" { return &orgRepoCtx{ IsAdmin: true, Link: path.Join(setting.AppSubURL, "/admin/hooks"), LinkNew: path.Join(setting.AppSubURL, "/admin/default-hooks"), NewTemplate: tplAdminHookNew, }, nil } // Must be system webhooks instead return &orgRepoCtx{ IsAdmin: true, IsSystemWebhook: true, Link: path.Join(setting.AppSubURL, "/admin/hooks"), LinkNew: path.Join(setting.AppSubURL, "/admin/system-hooks"), NewTemplate: tplAdminHookNew, }, nil ``` but was simplified to ``` return &ownerRepoCtx{ IsAdmin: true, IsSystemWebhook: ctx.Params(":configType") == "system-hooks", Link: path.Join(setting.AppSubURL, "/admin/hooks"), LinkNew: path.Join(setting.AppSubURL, "/admin/system-hooks"), NewTemplate: tplAdminHookNew, }, nil ``` In other words, combining the `IsSystemWebhook` check into a one-liner and forgetting that `LinkNew` also depended on it. This meant the rendered `<form>` always POSTed to `/admin/system-hooks`, even when you had GETed `/admin/default-hooks/gitea/new`.
This commit is contained in:
parent
a54c8b4ce9
commit
3d9ed62f4a
1 changed files with 1 additions and 1 deletions
|
@ -99,7 +99,7 @@ func getOwnerRepoCtx(ctx *context.Context) (*ownerRepoCtx, error) {
|
||||||
IsAdmin: true,
|
IsAdmin: true,
|
||||||
IsSystemWebhook: ctx.Params(":configType") == "system-hooks",
|
IsSystemWebhook: ctx.Params(":configType") == "system-hooks",
|
||||||
Link: path.Join(setting.AppSubURL, "/admin/hooks"),
|
Link: path.Join(setting.AppSubURL, "/admin/hooks"),
|
||||||
LinkNew: path.Join(setting.AppSubURL, "/admin/system-hooks"),
|
LinkNew: path.Join(setting.AppSubURL, "/admin/", ctx.Params(":configType")),
|
||||||
NewTemplate: tplAdminHookNew,
|
NewTemplate: tplAdminHookNew,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue