From dccb0b5be17050731b352e8a7e422f31426cf884 Mon Sep 17 00:00:00 2001 From: QuentinAndre Date: Mon, 26 Jul 2021 20:30:30 +0200 Subject: all in jquery and get_geo_items fixes --- ishtar_common/models_common.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'ishtar_common/models_common.py') diff --git a/ishtar_common/models_common.py b/ishtar_common/models_common.py index 5d1cd5d90..9b4dabf19 100644 --- a/ishtar_common/models_common.py +++ b/ishtar_common/models_common.py @@ -2871,16 +2871,16 @@ class GeoItem(models.Model): dict["geometry"]["coordinates"] = list_coords else: dict["geometry"]["type"] = "Point" - if self.multi_polygon: - dict["geometry"]["coordinates"] = self.convert_coordinates( - self.multi_polygon.centroid, rounded - ) - else: + if self.point_2d: try: x, y = self.display_coordinates dict["geometry"]["coordinates"] = [x, y] except ValueError: dict["geometry"]["coordinates"] = [] + else: + dict["geometry"]["coordinates"] = self.convert_coordinates( + self.multi_polygon.centroid, rounded + ) return dict def convert_coordinates(self, point_2d, rounded): -- cgit v1.2.3