summaryrefslogtreecommitdiffstats
path: root/modules/context/repo.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/context/repo.go')
-rw-r--r--modules/context/repo.go15
1 files changed, 11 insertions, 4 deletions
diff --git a/modules/context/repo.go b/modules/context/repo.go
index 2aee6caca4..63cb02dc06 100644
--- a/modules/context/repo.go
+++ b/modules/context/repo.go
@@ -411,11 +411,18 @@ func RepoAssignment() macaron.Handler {
owner, err = models.GetUserByName(userName)
if err != nil {
if models.IsErrUserNotExist(err) {
- if ctx.Query("go-get") == "1" {
- EarlyResponseForGoGetMeta(ctx)
- return
+ redirectUserID, err := models.LookupUserRedirect(userName)
+ if err == nil {
+ RedirectToUser(ctx, userName, redirectUserID)
+ } else if models.IsErrUserRedirectNotExist(err) {
+ if ctx.Query("go-get") == "1" {
+ EarlyResponseForGoGetMeta(ctx)
+ return
+ }
+ ctx.NotFound("GetUserByName", nil)
+ } else {
+ ctx.ServerError("LookupUserRedirect", err)
}
- ctx.NotFound("GetUserByName", nil)
} else {
ctx.ServerError("GetUserByName", err)
}