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
Update models/user.go
  • Loading branch information
zeripath committed May 8, 2020
commit 2ffb17f79ab62d74d7bbf7372ef9e4663cebfbab
1 change: 1 addition & 0 deletions models/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,7 @@ 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
defer sess.Close()

sess.Select("`user`.*, count(`repository`.id) as org_count").
Table("user").
Expand Down