aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/repo/compare.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/web/repo/compare.go')
-rw-r--r--routers/web/repo/compare.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/routers/web/repo/compare.go b/routers/web/repo/compare.go
index 706009820a..865a734caf 100644
--- a/routers/web/repo/compare.go
+++ b/routers/web/repo/compare.go
@@ -18,6 +18,7 @@ import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/models/unit"
+ user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/base"
"code.gitea.io/gitea/modules/charset"
"code.gitea.io/gitea/modules/context"
@@ -163,7 +164,7 @@ func setCsvCompareContext(ctx *context.Context) {
// CompareInfo represents the collected results from ParseCompareInfo
type CompareInfo struct {
- HeadUser *models.User
+ HeadUser *user_model.User
HeadRepo *models.Repository
HeadGitRepo *git.Repository
CompareInfo *git.CompareInfo
@@ -237,9 +238,9 @@ func ParseCompareInfo(ctx *context.Context) *CompareInfo {
} else if len(headInfos) == 2 {
headInfosSplit := strings.Split(headInfos[0], "/")
if len(headInfosSplit) == 1 {
- ci.HeadUser, err = models.GetUserByName(headInfos[0])
+ ci.HeadUser, err = user_model.GetUserByName(headInfos[0])
if err != nil {
- if models.IsErrUserNotExist(err) {
+ if user_model.IsErrUserNotExist(err) {
ctx.NotFound("GetUserByName", nil)
} else {
ctx.ServerError("GetUserByName", err)
@@ -262,7 +263,7 @@ func ParseCompareInfo(ctx *context.Context) *CompareInfo {
return nil
}
if err := ci.HeadRepo.GetOwner(); err != nil {
- if models.IsErrUserNotExist(err) {
+ if user_model.IsErrUserNotExist(err) {
ctx.NotFound("GetUserByName", nil)
} else {
ctx.ServerError("GetUserByName", err)