Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent ambiguous column error in organizations page #18314

Merged
merged 3 commits into from
Jan 18, 2022
Merged
Changes from all commits
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
10 changes: 5 additions & 5 deletions models/repo_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
),
),
),
Expand All @@ -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)},
)),
)
}
Expand Down Expand Up @@ -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}),
)
}

Expand Down