mirror of
https://github.com/ansible/awx.git
synced 2024-10-30 22:21:13 +03:00
Do not display inventory scripts for which the organization is inactive
This commit is contained in:
parent
45a7c1647f
commit
9ce6101cd4
@ -1463,7 +1463,7 @@ class CustomInventoryScriptAccess(BaseAccess):
|
||||
model = CustomInventoryScript
|
||||
|
||||
def get_queryset(self):
|
||||
qs = self.model.objects.filter(active=True).distinct()
|
||||
qs = self.model.objects.filter(active=True, organization__active=True).distinct()
|
||||
if not self.user.is_superuser:
|
||||
qs = qs.filter(Q(organization__admins__in=[self.user]) | Q(organization__users__in=[self.user]))
|
||||
return qs
|
||||
|
Loading…
Reference in New Issue
Block a user