From 9ce6101cd46d4c5bd7c37d01f7d279f9e11bbd55 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Thu, 18 Dec 2014 10:04:40 -0500 Subject: [PATCH] Do not display inventory scripts for which the organization is inactive --- awx/main/access.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/main/access.py b/awx/main/access.py index 2159af6c5b..df8cbb5cc9 100644 --- a/awx/main/access.py +++ b/awx/main/access.py @@ -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