diff options
Diffstat (limited to 'routers/web/explore/user.go')
-rw-r--r-- | routers/web/explore/user.go | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/routers/web/explore/user.go b/routers/web/explore/user.go index 1fe45ed585..8560378447 100644 --- a/routers/web/explore/user.go +++ b/routers/web/explore/user.go @@ -10,6 +10,7 @@ import ( "code.gitea.io/gitea/models" "code.gitea.io/gitea/models/db" + user_model "code.gitea.io/gitea/models/user" "code.gitea.io/gitea/modules/base" "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/setting" @@ -34,17 +35,17 @@ func isKeywordValid(keyword string) bool { } // RenderUserSearch render user search page -func RenderUserSearch(ctx *context.Context, opts *models.SearchUserOptions, tplName base.TplName) { +func RenderUserSearch(ctx *context.Context, opts *user_model.SearchUserOptions, tplName base.TplName) { opts.Page = ctx.FormInt("page") if opts.Page <= 1 { opts.Page = 1 } var ( - users []*models.User + users []*user_model.User count int64 err error - orderBy models.SearchOrderBy + orderBy db.SearchOrderBy ) // we can not set orderBy to `models.SearchOrderByXxx`, because there may be a JOIN in the statement, different tables may have the same name columns @@ -69,7 +70,7 @@ func RenderUserSearch(ctx *context.Context, opts *models.SearchUserOptions, tplN opts.Keyword = ctx.FormTrim("q") opts.OrderBy = orderBy if len(opts.Keyword) == 0 || isKeywordValid(opts.Keyword) { - users, count, err = models.SearchUsers(opts) + users, count, err = user_model.SearchUsers(opts) if err != nil { ctx.ServerError("SearchUsers", err) return @@ -100,9 +101,9 @@ func Users(ctx *context.Context) { ctx.Data["PageIsExploreUsers"] = true ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled - RenderUserSearch(ctx, &models.SearchUserOptions{ + RenderUserSearch(ctx, &user_model.SearchUserOptions{ Actor: ctx.User, - Type: models.UserTypeIndividual, + Type: user_model.UserTypeIndividual, ListOptions: db.ListOptions{PageSize: setting.UI.ExplorePagingNum}, IsActive: util.OptionalBoolTrue, Visible: []structs.VisibleType{structs.VisibleTypePublic, structs.VisibleTypeLimited, structs.VisibleTypePrivate}, |