mirror of
https://github.com/ansible/awx.git
synced 2024-10-31 23:51:09 +03:00
Merge pull request #4112 from jbradberry/fix-3603
Use the `in` operator to test against the Organization membership subquery Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
This commit is contained in:
commit
e269634afc
@ -1265,7 +1265,7 @@ class TeamAccess(BaseAccess):
|
||||
(self.user.admin_of_organizations.exists() or self.user.auditor_of_organizations.exists()):
|
||||
return self.model.objects.all()
|
||||
return self.model.objects.filter(
|
||||
Q(organization=Organization.accessible_pk_qs(self.user, 'member_role')) |
|
||||
Q(organization__in=Organization.accessible_pk_qs(self.user, 'member_role')) |
|
||||
Q(pk__in=self.model.accessible_pk_qs(self.user, 'read_role'))
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user