import / fix --> unions list / paginate orgs list in rancher link
This commit is contained in:
@@ -388,6 +388,26 @@ class OrganizationViewSet(BaseViewSet, ModelViewSet, DynamicSearchMixin):
|
||||
serializer = self.serializer_class(page, many=True)
|
||||
return self.get_paginated_response(serializer.data)
|
||||
|
||||
@action(
|
||||
methods=['get'],
|
||||
detail=False,
|
||||
url_path='get_union_orgs',
|
||||
url_name='get_union_orgs',
|
||||
name='get_union_orgs',
|
||||
)
|
||||
def get_union_orgs(self, request):
|
||||
"""
|
||||
list of unions
|
||||
"""
|
||||
|
||||
unions = self.get_queryset(visibility_by_org_scope=True)
|
||||
|
||||
page = self.paginate_queryset(unions.filter(type__key='U'))
|
||||
if page is not None: # noqa
|
||||
serializer = self.serializer_class(page, many=True)
|
||||
return self.get_paginated_response(serializer.data)
|
||||
return Response(status=status.HTTP_200_OK)
|
||||
|
||||
@action(
|
||||
methods=['get'],
|
||||
detail=False,
|
||||
|
||||
Reference in New Issue
Block a user