mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-05 12:29:05 +02:00
fix duplicate teams being returned by GetTeamsWithAccessToGroup
This commit is contained in:
1 parent
7f3e776867
commit
eaee8f07b1
1 file changed
+2
-2
@@ -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").
|
||||
|
||||
Reference in new issue
Block a user