Skip to content

Commit 65dceb6

Browse files
authored
Fix redirection path if Slack webhook channel is invalid (#10566)
The path to the hook config is already defined by orgRepoCtx
1 parent db26f0a commit 65dceb6

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

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

643643
if form.HasInvalidChannel() {
644644
ctx.Flash.Error(ctx.Tr("repo.settings.add_webhook.invalid_channel_name"))
645-
ctx.Redirect(fmt.Sprintf("%s/settings/hooks/%d", orCtx.Link, w.ID))
645+
ctx.Redirect(fmt.Sprintf("%s/%d", orCtx.Link, w.ID))
646646
return
647647
}
648648

0 commit comments

Comments
 (0)