Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly set the organization num repos #11339

Merged
merged 9 commits into from
May 11, 2020
Prev Previous commit
Next Next commit
as per @lunny
Signed-off-by: Andrew Thornton <[email protected]>
  • Loading branch information
zeripath committed May 8, 2020
commit 70ad0be72689108252ad2471352126bce35128cf
5 changes: 1 addition & 4 deletions models/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -713,9 +713,6 @@ func (u *User) GetOwnedOrganizations() (err error) {
// GetOrganizations returns paginated organizations that user belongs to.
func (u *User) GetOrganizations(opts *SearchOrganizationsOptions) error {
sess := x.NewSession()
zeripath marked this conversation as resolved.
Show resolved Hide resolved
if err := sess.Begin(); err != nil {
return err
}

sess.Select("`user`.*, count(`repository`.id) as org_count").
Table("user").
Expand Down Expand Up @@ -747,7 +744,7 @@ func (u *User) GetOrganizations(opts *SearchOrganizationsOptions) error {

u.Orgs = orgs

return sess.Commit()
return nil
}

// DisplayName returns full name if it's not empty,
Expand Down