From b36bd54a551eedb1129e60c3edc558591d417b9a Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 15 Mar 2022 13:02:28 +0100 Subject: Geodata: fix cached value update for geovector --- ishtar_common/utils.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'ishtar_common/utils.py') diff --git a/ishtar_common/utils.py b/ishtar_common/utils.py index a7e07ebde..88c9129a3 100644 --- a/ishtar_common/utils.py +++ b/ishtar_common/utils.py @@ -774,16 +774,13 @@ def _post_save_geodata(sender, **kwargs): modified = True # managed cached coordinates - # TODO cached_x, cached_y, cached_z = None, None, None - coords = instance.display_coordinates(rounded=False, dim=3) - if coords: + coords = instance.display_coordinates(rounded=False, dim=3, cache=False) + if coords and coords != [None, None, None]: cached_x, cached_y, cached_z = coords else: - coords = instance.display_coordinates(rounded=False, dim=2) - if not coords: - coords = instance.get_coordinates_from_polygon(rounded=False) + coords = instance.display_coordinates(rounded=False, dim=2, cache=False) if coords: cached_x, cached_y = coords -- cgit v1.2.3