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:
parent
1295e750b4
commit
5d113bdd19
2 changed files with 23 additions and 3 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue