summaryrefslogtreecommitdiff
path: root/ishtar_common/utils.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2025-11-29 16:45:39 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2025-11-29 16:45:39 +0100
commit47ae57c37abfed75f93594255b6c617afa011bf5 (patch)
treec9172a07ceb24b67854009b0c3cad9e365affe7b /ishtar_common/utils.py
parent713a5fd98aef4432977461dbf0b24790b9539053 (diff)
downloadIshtar-47ae57c37abfed75f93594255b6c617afa011bf5.tar.bz2
Ishtar-47ae57c37abfed75f93594255b6c617afa011bf5.zip
🐛 fix deletion of items with associated datations - better performance for deletion - delete directly associéted geovectordata
Diffstat (limited to 'ishtar_common/utils.py')
-rw-r--r--ishtar_common/utils.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/ishtar_common/utils.py b/ishtar_common/utils.py
index bd79814e9..bdd7a67e5 100644
--- a/ishtar_common/utils.py
+++ b/ishtar_common/utils.py
@@ -2402,20 +2402,23 @@ def manage_m2m(obj, kwargs):
obj.skip_history_when_saving = True
elif not obj.history_modifier:
obj.skip_history_when_saving = True
+ obj._post_save_geo_ok = True
obj.save()
def related_historization_changed(sender, **kwargs):
rel_obj = kwargs.get("instance", None)
- if not rel_obj or not getattr(rel_obj, "CURRENT_MODEL_ATTR", None):
+ if not rel_obj or not getattr(rel_obj, "CURRENT_MODEL_ATTR", None) or getattr(
+ rel_obj, "__delete", False):
return
obj = getattr(rel_obj, rel_obj.CURRENT_MODEL_ATTR)
+ obj._post_save_geo_ok = True
manage_m2m(obj, kwargs)
def m2m_historization_changed(sender, **kwargs):
obj = kwargs.get("instance", None)
- if not obj:
+ if not obj or getattr(obj, "__delete", False):
return
manage_m2m(obj, kwargs)