diff options
Diffstat (limited to 'models/org_team.go')
-rw-r--r-- | models/org_team.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/models/org_team.go b/models/org_team.go index 2dadf3820c..63c6e11636 100644 --- a/models/org_team.go +++ b/models/org_team.go @@ -914,7 +914,11 @@ func RemoveTeamMember(team *Team, userID int64) error { // IsUserInTeams returns if a user in some teams func IsUserInTeams(userID int64, teamIDs []int64) (bool, error) { - return x.Where("uid=?", userID).In("team_id", teamIDs).Exist(new(TeamUser)) + return isUserInTeams(x, userID, teamIDs) +} + +func isUserInTeams(e Engine, userID int64, teamIDs []int64) (bool, error) { + return e.Where("uid=?", userID).In("team_id", teamIDs).Exist(new(TeamUser)) } // UsersInTeamsCount counts the number of users which are in userIDs and teamIDs |