diff options
author | Unknwon <u@gogs.io> | 2016-03-09 23:18:39 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-03-09 23:18:39 -0500 |
commit | eed9966ad6cb2e6b0828733ab50cc133f16fc332 (patch) | |
tree | e8ab645d1a9daf10512c4fec10f1ee2f548b5fda /models | |
parent | ad513a20e939691828ba415c9a565e8ff3daa95f (diff) | |
download | gitea-eed9966ad6cb2e6b0828733ab50cc133f16fc332.tar.gz gitea-eed9966ad6cb2e6b0828733ab50cc133f16fc332.zip |
#2727 fix incompatible SQL in PostgreSQL
Diffstat (limited to 'models')
-rw-r--r-- | models/org.go | 7 |
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 |