aboutsummaryrefslogtreecommitdiffstats
path: root/models/org.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/org.go')
-rw-r--r--models/org.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/models/org.go b/models/org.go
index 1fee4f522d..c2665902ad 100644
--- a/models/org.go
+++ b/models/org.go
@@ -1071,11 +1071,10 @@ WHERE team_user.org_id = ? AND team_user.uid = ?`, org.Id, userID).Find(&teams);
}
repos := make([]*Repository, 0, 5)
- if err = x.Sql(`SELECT repository.* FROM repository
+ if err = x.Sql(fmt.Sprintf(`SELECT repository.* FROM repository
INNER JOIN team_repo ON team_repo.repo_id = repository.id
-WHERE (repository.owner_id = ? AND repository.is_private = ?) OR team_repo.team_id IN (?)
-GROUP BY repository.id`,
- org.Id, false, strings.Join(teamIDs, ",")).Find(&repos); err != nil {
+WHERE (repository.owner_id = ? AND repository.is_private = ?) OR team_repo.team_id IN (%s)
+GROUP BY repository.id`, strings.Join(teamIDs, ",")), org.Id, false).Find(&repos); err != nil {
return fmt.Errorf("get repositories: %v", err)
}
org.Repos = repos