diff --git a/services/search/api.py b/services/search/api.py index 6dfd8cd9..bd79e825 100644 --- a/services/search/api.py +++ b/services/search/api.py @@ -168,8 +168,12 @@ def to_representation(self, obj): if self.context["geometry"]: if hasattr(obj, "geometry"): + if isinstance(obj, AdministrativeDivision): + geometry = obj.geometry.boundary + else: + geometry = obj.geometry representation["geometry"] = munigeo_api.geom_to_json( - obj.geometry, DEFAULT_SRS + geometry, DEFAULT_SRS ) else: representation["geometry"] = None