fix organization_by_province

This commit is contained in:
2025-10-28 09:59:53 +03:30
parent f7df23abe3
commit a333a5e5a8
2 changed files with 4 additions and 2 deletions

View File

@@ -313,9 +313,9 @@ class OrganizationViewSet(BaseViewSet, SoftDeleteMixin, ModelViewSet, DynamicSea
""" list of organizations by province """
if 'province' in request.GET.keys():
queryset = self.queryset.filter(province=int(request.GET['province']))
queryset = self.get_queryset().filter(province=int(request.GET['province']))
else:
queryset = self.queryset.filter(province=request.user.province)
queryset = self.get_queryset().filter(province=request.user.province)
if 'exclude' in request.GET.keys():
queryset = queryset.exclude(type__key=request.GET['exclude'])

View File

@@ -303,3 +303,5 @@ django.core.exceptions.FieldError: Unsupported lookup 'name' for ForeignKey or j
[2025-10-28 09:48:08,454] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\core\api.py changed, reloading.
[2025-10-28 09:48:11,301] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader
[2025-10-28 09:51:26,296] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\authorization\services\role_child.py changed, reloading.
[2025-10-28 09:51:28,557] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader
[2025-10-28 09:58:41,881] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\authentication\api\v1\api.py changed, reloading.