summaryrefslogtreecommitdiffstats
path: root/models/repo_list.go
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2022-01-18 07:45:14 +0000
committerGitHub <noreply@github.com>2022-01-18 07:45:14 +0000
commita7ee4d507a0edb2fa90ac25299a27298de941a41 (patch)
treefe1e3d21706475c04cddc9b4ea2a51c4b148fda5 /models/repo_list.go
parent851b54ba9fb80b47367071cf671872c881c6ae6e (diff)
downloadgitea-a7ee4d507a0edb2fa90ac25299a27298de941a41.tar.gz
gitea-a7ee4d507a0edb2fa90ac25299a27298de941a41.zip
Prevent ambiguous column error in organizations page (#18314)
Explicitly set the table for the org_id column queries on the organizations pages. Fix #18229 Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'models/repo_list.go')
-rw-r--r--models/repo_list.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/models/repo_list.go b/models/repo_list.go
index 9bda0d5a37..9cb7a163fc 100644
--- a/models/repo_list.go
+++ b/models/repo_list.go
@@ -244,9 +244,9 @@ func teamUnitsRepoCond(id string, userID, orgID, teamID int64, units ...unit.Typ
builder.In(
"team_id", builder.Select("team_id").From("team_unit").Where(
builder.Eq{
- "org_id": orgID,
+ "`team_unit`.org_id": orgID,
}.And(
- builder.In("type", units),
+ builder.In("`team_unit`.type", units),
),
),
),
@@ -259,8 +259,8 @@ func userCollaborationRepoCond(idStr string, userID int64) builder.Cond {
return builder.In(idStr, builder.Select("repo_id").
From("`access`").
Where(builder.And(
- builder.Eq{"user_id": userID},
- builder.Gt{"mode": int(perm.AccessModeNone)},
+ builder.Eq{"`access`.user_id": userID},
+ builder.Gt{"`access`.mode": int(perm.AccessModeNone)},
)),
)
}
@@ -289,7 +289,7 @@ func userOrgTeamUnitRepoBuilder(userID int64, unitType unit.Type) *builder.Build
func userOrgUnitRepoCond(idStr string, userID, orgID int64, unitType unit.Type) builder.Cond {
return builder.In(idStr,
userOrgTeamUnitRepoBuilder(userID, unitType).
- And(builder.Eq{"org_id": orgID}),
+ And(builder.Eq{"`team_unit`.org_id": orgID}),
)
}