Browse Source

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 <lauris@nix.lv>
tags/v1.10.5
James Lakin 4 years ago
parent
commit
c08c975d36
No account linked to committer's email address
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      routers/repo/webhook.go

+ 2
- 2
routers/repo/webhook.go View File

@@ -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
}


Loading…
Cancel
Save