From 102245e0088963f3f31d41ce086fda0d5d70a05c Mon Sep 17 00:00:00 2001 From: QuentinAndre Date: Fri, 16 Jul 2021 07:27:00 +0200 Subject: get_geo_items for operations and tests --- ishtar_common/models_common.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'ishtar_common/models_common.py') diff --git a/ishtar_common/models_common.py b/ishtar_common/models_common.py index 22823a5d9..f99252fd2 100644 --- a/ishtar_common/models_common.py +++ b/ishtar_common/models_common.py @@ -2884,8 +2884,11 @@ class GeoItem(models.Model): self.multi_polygon.centroid, rounded ) else: - x, y = self.display_coordinates - dict["geometry"]["coordinates"] = [x, y] + try: + x, y = self.display_coordinates + dict["geometry"]["coordinates"] = [x, y] + except ValueError: + dict["geometry"]["coordinates"] = [] return dict def convert_coordinates(self, point_2d, rounded): -- cgit v1.2.3