summaryrefslogtreecommitdiffstats
path: root/modules/context/org.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/context/org.go')
-rw-r--r--modules/context/org.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/context/org.go b/modules/context/org.go
index 9b87fba9fd..f61a39c666 100644
--- a/modules/context/org.go
+++ b/modules/context/org.go
@@ -54,7 +54,14 @@ func HandleOrgAssignment(ctx *Context, args ...bool) {
ctx.Org.Organization, err = models.GetUserByName(orgName)
if err != nil {
if models.IsErrUserNotExist(err) {
- ctx.NotFound("GetUserByName", err)
+ redirectUserID, err := models.LookupUserRedirect(orgName)
+ if err == nil {
+ RedirectToUser(ctx, orgName, redirectUserID)
+ } else if models.IsErrUserRedirectNotExist(err) {
+ ctx.NotFound("GetUserByName", err)
+ } else {
+ ctx.ServerError("LookupUserRedirect", err)
+ }
} else {
ctx.ServerError("GetUserByName", err)
}