diff --git a/routers/web/org/members.go b/routers/web/org/members.go index 92fbed01a2..ff7358d02f 100644 --- a/routers/web/org/members.go +++ b/routers/web/org/members.go @@ -83,6 +83,8 @@ func MembersAction(ctx *context.Context) { return } + redirectURL := ctx.FormString("redirect") + org := ctx.Org.Organization var err error switch ctx.Params(":action") { @@ -134,7 +136,11 @@ func MembersAction(ctx *context.Context) { return } - log.Info("redirecting to", ctx.Org.OrgLink) + if redirectURL != "" { + ctx.JSONRedirect(redirectURL) + return + } + redirect := ctx.Org.OrgLink + "/members" if ctx.Params(":action") == "leave" { redirect = setting.AppSubURL + "/" diff --git a/templates/user/settings/organization.tmpl b/templates/user/settings/organization.tmpl index 335e91e5e1..97b143579e 100644 --- a/templates/user/settings/organization.tmpl +++ b/templates/user/settings/organization.tmpl @@ -25,9 +25,9 @@