1
0
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:
Matthew Jones 2014-12-18 10:04:40 -05:00
parent 45a7c1647f
commit 9ce6101cd4

View File

@ -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