Remove User.GetOrganizations() (#14032)

as title
This commit is contained in:
6543 2021-06-18 19:00:53 +02:00 committed by GitHub
parent 59f25587e8
commit 889dea8fc1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 56 deletions

View file

@ -114,11 +114,12 @@ func doCheckOrgCounts(username string, orgCounts map[string]int, strict bool, ca
Name: username,
}).(*models.User)
user.GetOrganizations(&models.SearchOrganizationsOptions{All: true})
orgs, err := models.GetOrgsByUserID(user.ID, true)
assert.NoError(t, err)
calcOrgCounts := map[string]int{}
for _, org := range user.Orgs {
for _, org := range orgs {
calcOrgCounts[org.LowerName] = org.NumRepos
count, ok := canonicalCounts[org.LowerName]
if ok {