import - org_id in params for childs & org linked ranchers

This commit is contained in:
2025-12-23 12:23:00 +03:30
parent 0937d1f3ca
commit 5286eb540f
2 changed files with 14 additions and 5 deletions

View File

@@ -302,7 +302,12 @@ class RancherOrganizationLinkViewSet(
"""
list of organizations with rancher information
"""
org = get_organization_by_user(request.user)
query_params = self.request.query_params # noqa
if not 'org_id' in query_params.keys():
org = get_organization_by_user(request.user)
else:
org = Organization.objects.get(id=query_params.get('org_id'))
result = self.orgs_linked_rancher(org=org, org_type_key='CO')
page = self.paginate_queryset(result) # paginate queryset