summaryrefslogtreecommitdiffstats
path: root/routers/user/profile.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/user/profile.go')
-rw-r--r--routers/user/profile.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/routers/user/profile.go b/routers/user/profile.go
index bd5b359272..e19407baa7 100644
--- a/routers/user/profile.go
+++ b/routers/user/profile.go
@@ -23,7 +23,11 @@ func GetUserByName(ctx *context.Context, name string) *models.User {
user, err := models.GetUserByName(name)
if err != nil {
if models.IsErrUserNotExist(err) {
- ctx.NotFound("GetUserByName", nil)
+ if redirectUserID, err := models.LookupUserRedirect(name); err == nil {
+ context.RedirectToUser(ctx, name, redirectUserID)
+ } else {
+ ctx.NotFound("GetUserByName", err)
+ }
} else {
ctx.ServerError("GetUserByName", err)
}