From 7659da6162aa565e3676330917174851f377e91f Mon Sep 17 00:00:00 2001 From: Akita Noek Date: Sat, 16 Apr 2016 08:36:36 -0400 Subject: [PATCH] Fixes for old/ad_hoc.py tests --- awx/main/access.py | 2 +- awx/main/tests/old/ad_hoc.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/awx/main/access.py b/awx/main/access.py index 32e600fbe9..c4c8f05517 100644 --- a/awx/main/access.py +++ b/awx/main/access.py @@ -361,7 +361,7 @@ class HostAccess(BaseAccess): def get_queryset(self): inv_qs = Inventory.accessible_objects(self.user, 'read_role') group_qs = Group.accessible_objects(self.user, 'read_role') - qs = (self.model.filter(inventory=inv_qs) | self.model.filter(group=group_qs)).distinct() + qs = (self.model.objects.filter(inventory=inv_qs) | self.model.objects.filter(groups=group_qs)).distinct() qs = qs.select_related('created_by', 'modified_by', 'inventory', 'last_job__job_template', 'last_job_host_summary__job') diff --git a/awx/main/tests/old/ad_hoc.py b/awx/main/tests/old/ad_hoc.py index f69d58072d..279b98f3ae 100644 --- a/awx/main/tests/old/ad_hoc.py +++ b/awx/main/tests/old/ad_hoc.py @@ -1025,7 +1025,7 @@ class AdHocCommandApiTest(BaseAdHocCommandTest): # Update permission to allow other user to run ad hoc commands. Can # only see his own ad hoc commands (because of credential permission). with self.current_user('admin'): - response = self.post(user_roles_list_url, {"id": self.inventory.execute_role.id}, expect=204) + response = self.post(user_roles_list_url, {"id": self.inventory.adhoc_role.id}, expect=204) with self.current_user('other'): response = self.get(url, expect=200) self.assertEqual(response['count'], 0)