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>
This commit is contained in:
Lunny Xiaoand6543 authored and GitHub committed 2021-06-14 20:18:09 +08:00
1 parent 1295e750b4
commit 5d113bdd19
2 files changed
+23 -3

No files matched your search

+4 -3
View File
@@ -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
}