mirror of
https://github.com/ansible/awx.git
synced 2026-02-23 14:05:59 -03:30
Updated the org users and org admins api list endpoints to use new member_role.members
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user