Skip to content

Commit 3f044b0

Browse files
committed
Reenable creating default webhooks.
Fixes #24624 This seems to have been broken in #21563 Previously, the 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 ``` combining the IsSystemWebhook check into a one-liner, but forgtting the same for LinkNew.
1 parent 5930ab5 commit 3f044b0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

routers/web/repo/webhook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func getOwnerRepoCtx(ctx *context.Context) (*ownerRepoCtx, error) {
9999
IsAdmin: true,
100100
IsSystemWebhook: ctx.Params(":configType") == "system-hooks",
101101
Link: path.Join(setting.AppSubURL, "/admin/hooks"),
102-
LinkNew: path.Join(setting.AppSubURL, "/admin/system-hooks"),
102+
LinkNew: "/admin/" + ctx.Params(":configType"),
103103
NewTemplate: tplAdminHookNew,
104104
}, nil
105105
}

0 commit comments

Comments
 (0)