Skip to content

Commit c08c975

Browse files
Fix redirection path if Slack webhook channel is invalid (#10548)
The path to the hook config is already defined by orgRepoCtx Co-authored-by: Lauris BH <[email protected]>
1 parent f9d34b2 commit c08c975

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

routers/repo/webhook.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ func SlackHooksNewPost(ctx *context.Context, form auth.NewSlackHookForm) {
448448

449449
if form.HasInvalidChannel() {
450450
ctx.Flash.Error(ctx.Tr("repo.settings.add_webhook.invalid_channel_name"))
451-
ctx.Redirect(orCtx.Link + "/settings/hooks/slack/new")
451+
ctx.Redirect(orCtx.Link + "/slack/new")
452452
return
453453
}
454454

@@ -682,7 +682,7 @@ func SlackHooksEditPost(ctx *context.Context, form auth.NewSlackHookForm) {
682682

683683
if form.HasInvalidChannel() {
684684
ctx.Flash.Error(ctx.Tr("repo.settings.add_webhook.invalid_channel_name"))
685-
ctx.Redirect(fmt.Sprintf("%s/settings/hooks/%d", orCtx.Link, w.ID))
685+
ctx.Redirect(fmt.Sprintf("%s/%d", orCtx.Link, w.ID))
686686
return
687687
}
688688

0 commit comments

Comments
 (0)