From 6f8e388b5530e85f141ea3aa345b1c6842fbe1f5 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Sun, 26 Jul 2015 19:22:17 +0800 Subject: fix #1169 - prevent create reop on existed path --- modules/middleware/org.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'modules/middleware/org.go') diff --git a/modules/middleware/org.go b/modules/middleware/org.go index 0e544fe4..1ac4bcf1 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 { -- cgit v1.2.3