diff --git a/awx/api/generics.py b/awx/api/generics.py index 3c1321300c..23dcce4d35 100644 --- a/awx/api/generics.py +++ b/awx/api/generics.py @@ -299,7 +299,7 @@ class SubListAPIView(ListAPIView, ParentMixin): parent = self.get_parent_object() self.check_parent_access(parent) qs = self.request.user.get_queryset(self.model).distinct() - sublist_qs = getattr(parent, self.relationship).distinct() + sublist_qs = getattrd(parent, self.relationship).distinct() return qs & sublist_qs class SubListCreateAPIView(SubListAPIView, ListCreateAPIView): diff --git a/awx/api/views.py b/awx/api/views.py index 1a1ce35346..cac06c4fd0 100644 --- a/awx/api/views.py +++ b/awx/api/views.py @@ -633,14 +633,14 @@ class OrganizationUsersList(SubListCreateAttachDetachAPIView): model = User serializer_class = UserSerializer parent_model = Organization - relationship = 'users' + relationship = 'member_role.members' class OrganizationAdminsList(SubListCreateAttachDetachAPIView): model = User serializer_class = UserSerializer parent_model = Organization - relationship = 'admins' + relationship = 'admin_role.members' class OrganizationProjectsList(SubListCreateAttachDetachAPIView):