Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix test
  • Loading branch information
lunny committed Nov 21, 2021
commit ebccf6c4c0a65b534ea38efdc20da291610dbb48
2 changes: 1 addition & 1 deletion models/org.go
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ func GetUserOrgsList(user *User) ([]*MinimalOrg, error) {
groupByStr = groupByStr[0 : len(groupByStr)-1]

sess := db.GetEngine(db.DefaultContext)
sess.Select(groupByStr+", count(distinct repo_id) as org_count").
sess = sess.Select(groupByStr+", count(distinct repo_id) as org_count").
Table("user").
Join("INNER", "team", "`team`.org_id = `user`.id").
Join("INNER", "team_user", "`team`.id = `team_user`.team_id").
Expand Down
2 changes: 1 addition & 1 deletion models/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -1777,7 +1777,7 @@ func GetUserRepositories(opts *SearchRepoOptions) ([]*Repository, int64, error)
return nil, 0, fmt.Errorf("Count: %v", err)
}

sess.Where(cond).OrderBy(opts.OrderBy.String())
sess = sess.Where(cond).OrderBy(opts.OrderBy.String())
repos := make([]*Repository, 0, opts.PageSize)
return repos, count, db.SetSessionPagination(sess, opts).Find(&repos)
}
Expand Down