diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-02-17 13:03:40 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-12-12 12:21:00 +0100 |
commit | 1205622c9acfef772a73c15352a4fa812ca7e358 (patch) | |
tree | 00b6f9ca825f89ba76900c3095e9191410c5451f /ishtar_common/utils.py | |
parent | b93a677cc30d92a0efa0ca8be52614ed1eb67329 (diff) | |
download | Ishtar-1205622c9acfef772a73c15352a4fa812ca7e358.tar.bz2 Ishtar-1205622c9acfef772a73c15352a4fa812ca7e358.zip |
Geodata redesign: operation migrations (1/2) - operation geo post save - town area creation
Diffstat (limited to 'ishtar_common/utils.py')
-rw-r--r-- | ishtar_common/utils.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ishtar_common/utils.py b/ishtar_common/utils.py index eab25a56f..02eeff93c 100644 --- a/ishtar_common/utils.py +++ b/ishtar_common/utils.py @@ -769,6 +769,11 @@ def _post_save_geodata(sender, **kwargs): return modified = False + if getattr(instance, "post_save_geo", False): + instance.post_save_geo(save=False) + modified = True + + # managed cached coordinates cached_x, cached_y, cached_z = None, None, None coords = instance.display_coordinates(rounded=False, dim=3) @@ -794,6 +799,8 @@ def _post_save_geodata(sender, **kwargs): if modified: instance._post_saved_geo = True + instance._no_move = True + instance.skip_history_when_saving = True instance.save() cache_key, __ = get_cache(sender, ("post_save_geo", instance.pk)) cache.set(cache_key, None, settings.CACHE_TASK_TIMEOUT) |