summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-06-14 20:18:09 +0800
committerGitHub <noreply@github.com>2021-06-14 20:18:09 +0800
commit5d113bdd1905c73fb8071f420ae2d248202971f9 (patch)
treeada92c8b506c64218fa1340879117c5ea2c2309f /routers
parent1295e750b4b8cec5476e7666bf9f8f3a02b39785 (diff)
downloadgitea-5d113bdd1905c73fb8071f420ae2d248202971f9.tar.gz
gitea-5d113bdd1905c73fb8071f420ae2d248202971f9.zip
Improve performance of dashboard list orgs (#16099)
* Improve performance of dashboard list orgs * Fix wrong error description * unexport queryUserOrgIDs method * SimpleOrg -> MinimalOrg * . Co-authored-by: 6543 <6543@obermui.de>
Diffstat (limited to 'routers')
-rw-r--r--routers/web/user/home.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/routers/web/user/home.go b/routers/web/user/home.go
index acf73f82fe..d3fc36c730 100644
--- a/routers/web/user/home.go
+++ b/routers/web/user/home.go
@@ -49,11 +49,12 @@ func getDashboardContextUser(ctx *context.Context) *models.User {
}
ctx.Data["ContextUser"] = ctxUser
- if err := ctx.User.GetOrganizations(&models.SearchOrganizationsOptions{All: true}); err != nil {
- ctx.ServerError("GetOrganizations", err)
+ orgs, err := models.GetUserOrgsList(ctx.User.ID)
+ if err != nil {
+ ctx.ServerError("GetUserOrgsList", err)
return nil
}
- ctx.Data["Orgs"] = ctx.User.Orgs
+ ctx.Data["Orgs"] = orgs
return ctxUser
}