mirror of
https://github.com/go-gitea/gitea.git
synced 2026-04-13 09:35:13 +02:00
fix duplicate teams being returned by GetTeamsWithAccessToGroup
This commit is contained in:
parent
7f3e776867
commit
eaee8f07b1
@ -11,8 +11,8 @@ import (
|
||||
func GetTeamsWithAccessToGroup(ctx context.Context, orgID, groupID int64, mode perm.AccessMode) ([]*Team, error) {
|
||||
teams := make([]*Team, 0)
|
||||
inCond := group_model.ParentGroupCond("group_team.group_id", groupID)
|
||||
return teams, db.GetEngine(ctx).Where("group_team.access_mode >= ?", mode).
|
||||
Join("INNER", "group_team", "group_team.team_id = team.id").
|
||||
return teams, db.GetEngine(ctx).Distinct("team.*").Where("group_team.access_mode >= ?", mode).
|
||||
Join("INNER", "group_team", "group_team.team_id = team.id and group_team.org_id = ?", orgID).
|
||||
And("group_team.org_id = ?", orgID).
|
||||
And(inCond).
|
||||
OrderBy("name").
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user