File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -58,20 +58,23 @@ func PrepareContextForProfileBigAvatar(ctx *context.Context) {
5858 }
5959
6060 showPrivate := ctx .IsSigned && (ctx .Doer .IsAdmin || ctx .Doer .ID == ctx .ContextUser .ID )
61- orgs , count , err := db .FindAndCount [organization.Organization ](ctx , organization.FindOrgOptions {
61+ orgs , err := db .Find [organization.Organization ](ctx , organization.FindOrgOptions {
6262 UserID : ctx .ContextUser .ID ,
6363 IncludePrivate : showPrivate ,
6464 ListOptions : db.ListOptions {
6565 Page : 1 ,
66- PageSize : setting .UI .User .OrgPagingNum ,
66+ PageSize : setting .UI .User .OrgPagingNum + 1 ,
6767 },
6868 })
6969 if err != nil {
7070 ctx .ServerError ("FindOrgs" , err )
7171 return
7272 }
73+ if len (orgs ) > setting .UI .User .OrgPagingNum {
74+ orgs = orgs [:setting .UI .User .OrgPagingNum ]
75+ ctx .Data ["ShowMoreOrgs" ] = true
76+ }
7377 ctx .Data ["Orgs" ] = orgs
74- ctx .Data ["ShowMoreOrgs" ] = int (count ) > setting .UI .User .OrgPagingNum
7578 ctx .Data ["HasOrgsVisible" ] = organization .HasOrgsVisible (ctx , orgs , ctx .Doer )
7679
7780 badges , _ , err := user_model .GetUserBadges (ctx , ctx .ContextUser )
You can’t perform that action at this time.
0 commit comments