From 65dceb6a4091b8a3024d9ede1d7db3b7e47494f7 Mon Sep 17 00:00:00 2001 From: James Lakin Date: Mon, 2 Mar 2020 11:54:07 +0000 Subject: [PATCH] Fix redirection path if Slack webhook channel is invalid (#10566) The path to the hook config is already defined by orgRepoCtx --- routers/repo/webhook.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routers/repo/webhook.go b/routers/repo/webhook.go index 9ae15882c1..53f39d63a3 100644 --- a/routers/repo/webhook.go +++ b/routers/repo/webhook.go @@ -448,7 +448,7 @@ func SlackHooksNewPost(ctx *context.Context, form auth.NewSlackHookForm) { if form.HasInvalidChannel() { ctx.Flash.Error(ctx.Tr("repo.settings.add_webhook.invalid_channel_name")) - ctx.Redirect(orCtx.Link + "/settings/hooks/slack/new") + ctx.Redirect(orCtx.Link + "/slack/new") return } @@ -642,7 +642,7 @@ func SlackHooksEditPost(ctx *context.Context, form auth.NewSlackHookForm) { if form.HasInvalidChannel() { ctx.Flash.Error(ctx.Tr("repo.settings.add_webhook.invalid_channel_name")) - ctx.Redirect(fmt.Sprintf("%s/settings/hooks/%d", orCtx.Link, w.ID)) + ctx.Redirect(fmt.Sprintf("%s/%d", orCtx.Link, w.ID)) return }