summaryrefslogtreecommitdiffstats
path: root/models/org.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-03-01 14:39:28 -0500
committerUnknwon <u@gogs.io>2016-03-01 14:39:28 -0500
commit97429a25ab6a0cef263edf85124bae73c5457b9c (patch)
tree63a021e7560755ac0984e9580703ceb7894e0c63 /models/org.go
parent9e89584cb4aa6321311dd291c364c5d956fcead1 (diff)
downloadgitea-97429a25ab6a0cef263edf85124bae73c5457b9c.tar.gz
gitea-97429a25ab6a0cef263edf85124bae73c5457b9c.zip
#2727 make IN clause compatible with Postgres
Diffstat (limited to 'models/org.go')
-rw-r--r--models/org.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/models/org.go b/models/org.go
index 9d86df1027..f70d182c7b 100644
--- a/models/org.go
+++ b/models/org.go
@@ -1060,7 +1060,7 @@ func (org *User) GetUserRepositories(userID int64) (err error) {
And("`team_user`.uid=?", userID).
Join("INNER", "`team_user`", "`team_user`.team_id=`team`.id").
Find(&teams); err != nil {
- return fmt.Errorf("GetUserRepositories: get teams: %v", err)
+ return fmt.Errorf("get teams: %v", err)
}
teamIDs := make([]string, len(teams))
@@ -1080,10 +1080,10 @@ func (org *User) GetUserRepositories(userID int64) (err error) {
Join("INNER", "`team_repo`", "`team_repo`.repo_id=`repository`.id").
Where("`repository`.owner_id=?", org.Id).
And("`repository`.is_private=?", false).
- Or("`team_repo`.team_id=(?)", strings.Join(teamIDs, ",")).
+ Or("`team_repo`.team_id IN (?)", strings.Join(teamIDs, ",")).
GroupBy("`repository`.id").
Find(&org.Repos); err != nil {
- return fmt.Errorf("GetUserRepositories: get repositories: %v", err)
+ return fmt.Errorf("get repositories: %v", err)
}
// FIXME: should I change this value inside method,