From 0937d1f3cacd5f3ce3e9a7bbd1c6102d9d2d890c Mon Sep 17 00:00:00 2001 From: Mojtaba-z Date: Tue, 23 Dec 2025 11:50:37 +0330 Subject: [PATCH] fix - org linked rancher list pagination bug --- apps/authentication/api/v1/api.py | 4 ++-- apps/herd/web/api/v1/api.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/authentication/api/v1/api.py b/apps/authentication/api/v1/api.py index c215a2f..99be036 100644 --- a/apps/authentication/api/v1/api.py +++ b/apps/authentication/api/v1/api.py @@ -377,10 +377,10 @@ class OrganizationViewSet(BaseViewSet, ModelViewSet, DynamicSearchMixin): def get_child_organizations(self, request): organization = get_organization_by_user(request.user) child_organizations = self.get_all_org_child(organization) - # search & filter queryset = self.filter_query( - self.get_queryset()) + self.get_queryset() + ) if not 'org_id' in self.request.query_params.keys() else self.get_all_org_child(organization) page = self.paginate_queryset(queryset) # paginate queryset diff --git a/apps/herd/web/api/v1/api.py b/apps/herd/web/api/v1/api.py index 9d324a8..0973496 100644 --- a/apps/herd/web/api/v1/api.py +++ b/apps/herd/web/api/v1/api.py @@ -306,7 +306,9 @@ class RancherOrganizationLinkViewSet( result = self.orgs_linked_rancher(org=org, org_type_key='CO') page = self.paginate_queryset(result) # paginate queryset - return self.get_paginated_response(result) + if page is not None: + return self.get_paginated_response(page) + return Response(result) @action( methods=['get'],