diff options
Diffstat (limited to 'modules/middleware/org.go')
-rw-r--r-- | modules/middleware/org.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/middleware/org.go b/modules/middleware/org.go index 0e544fe4a2..1ac4bcf1ae 100644 --- a/modules/middleware/org.go +++ b/modules/middleware/org.go @@ -47,6 +47,12 @@ func OrgAssignment(redirect bool, args ...bool) macaron.Handler { org := ctx.Org.Organization ctx.Data["Org"] = org + // Force redirection when username is actually a user. + if !org.IsOrganization() { + ctx.Redirect("/" + org.Name) + return + } + if ctx.IsSigned { ctx.Org.IsOwner = org.IsOwnedBy(ctx.User.Id) if ctx.Org.IsOwner { |