aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/repo/http.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-11-11 15:03:30 +0800
committerGitHub <noreply@github.com>2021-11-11 15:03:30 +0800
commit90eb9fb889e5d3a5845576dbc63e3792f3da33f2 (patch)
tree4107df9dd446fe9a93e49cba1e59d0f721e70351 /routers/web/repo/http.go
parent492e1c2fbd1b646f4428207942a9f89b56f7b6a9 (diff)
downloadgitea-90eb9fb889e5d3a5845576dbc63e3792f3da33f2.tar.gz
gitea-90eb9fb889e5d3a5845576dbc63e3792f3da33f2.zip
Move EmailAddress & UserRedirect into models/user/ (#17607)
* Move EmailAddress into models/user/ * Fix test * rename user_mail to user_email * Fix test * Move UserRedirect into models/user/ * Fix lint & test * Fix lint * Fix lint * remove nolint comment * Fix lint
Diffstat (limited to 'routers/web/repo/http.go')
-rw-r--r--routers/web/repo/http.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/routers/web/repo/http.go b/routers/web/repo/http.go
index 7c5dcd42be..0626d08a7c 100644
--- a/routers/web/repo/http.go
+++ b/routers/web/repo/http.go
@@ -23,6 +23,7 @@ import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/models/login"
"code.gitea.io/gitea/models/unit"
+ user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/context"
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/log"
@@ -112,7 +113,7 @@ func httpBase(ctx *context.Context) (h *serviceHandler) {
owner, err := models.GetUserByName(username)
if err != nil {
if models.IsErrUserNotExist(err) {
- if redirectUserID, err := models.LookupUserRedirect(username); err == nil {
+ if redirectUserID, err := user_model.LookupUserRedirect(username); err == nil {
context.RedirectToUser(ctx, username, redirectUserID)
} else {
ctx.NotFound(fmt.Sprintf("User %s does not exist", username), nil)