From 0fab6747f9a2b8ff4725cc093c9394ed46feaac3 Mon Sep 17 00:00:00 2001 From: sudan45 Date: Thu, 26 Sep 2024 11:56:15 +0545 Subject: [PATCH] Filter project wise geo filter in entry tags --- apps/entry/dataloaders.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/entry/dataloaders.py b/apps/entry/dataloaders.py index d24f3e6317..e3fd48fd24 100644 --- a/apps/entry/dataloaders.py +++ b/apps/entry/dataloaders.py @@ -15,6 +15,7 @@ Attribute, EntryGroupLabel, ) +from geo.models import GeoArea class EntryLoader(DataLoaderWithContext): @@ -52,7 +53,9 @@ def batch_load_fn(self, keys): class AttributeGeoSelectedOptionsLoader(DataLoaderWithContext): def batch_load_fn(self, keys): - geo_area_qs = get_geo_area_queryset_for_project_geo_area_type().filter( + geo_area_qs = get_geo_area_queryset_for_project_geo_area_type( + queryset=GeoArea.get_for_project(self.context.active_project) + ).filter( id__in={id for ids in keys for id in ids} ).defer('polygons') geo_area_map = {