From c08c975d368771237d6509df915d3ec315186612 Mon Sep 17 00:00:00 2001 From: James Lakin Date: Sun, 1 Mar 2020 16:51:55 +0000 Subject: [PATCH] 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 --- 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 009a9e223..845498967 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 } @@ -682,7 +682,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 }