From 59029491cb34107e72d02d88e6664df5e827440f Mon Sep 17 00:00:00 2001 From: Mojtaba-z Date: Mon, 27 Oct 2025 16:27:11 +0330 Subject: [PATCH] set to list of ids from org - BaseViewSet --- apps/core/api.py | 2 +- logs/django_requests.log | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/core/api.py b/apps/core/api.py index 31d407e..605d15a 100644 --- a/apps/core/api.py +++ b/apps/core/api.py @@ -33,7 +33,7 @@ class BaseViewSet(RegionFilterMixin, viewsets.ModelViewSet): queryset = (queryset.filter(organization__in=child_orgs)) elif model_name == 'organization': - queryset = queryset.filter(id__in=child_orgs) + queryset = queryset.filter(id__in=[org.id for org in child_orgs]) return queryset diff --git a/logs/django_requests.log b/logs/django_requests.log index 8e719fb..8f91376 100644 --- a/logs/django_requests.log +++ b/logs/django_requests.log @@ -35,3 +35,5 @@ [2025-10-27 16:15:30,229] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\core\api.py changed, reloading. [2025-10-27 16:15:32,562] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader [2025-10-27 16:22:54,143] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\core\api.py changed, reloading. +[2025-10-27 16:22:56,067] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader +[2025-10-27 16:26:54,114] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\core\api.py changed, reloading.