1
0
Fork 0
forked from forgejo/forgejo

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 Xiao 2021-06-14 20:18:09 +08:00 committed by GitHub
parent 1295e750b4
commit 5d113bdd19
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 3 deletions

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
}