summaryrefslogtreecommitdiffstats
path: root/modules/middleware/org.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-07-26 19:22:17 +0800
committerUnknwon <u@gogs.io>2015-07-26 19:22:17 +0800
commit6f8e388b5530e85f141ea3aa345b1c6842fbe1f5 (patch)
tree3ea3119fa2a1292c801aaddddc00308c434bf6ca /modules/middleware/org.go
parent436ef5b50a32c7ff2053bce7f5b3eaf6abe0c984 (diff)
downloadgitea-6f8e388b5530e85f141ea3aa345b1c6842fbe1f5.tar.gz
gitea-6f8e388b5530e85f141ea3aa345b1c6842fbe1f5.zip
fix #1169
- prevent create reop on existed path
Diffstat (limited to 'modules/middleware/org.go')
-rw-r--r--modules/middleware/org.go6
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 {