From 3f1de491d60943b8d8f82088febe2af89a8801de Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 8 Aug 2023 12:20:07 +0200 Subject: ⚡️ optimise post-treatments: prevent unnecessary cascade update (refs #5617) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ishtar_common/models_common.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ishtar_common/models_common.py') diff --git a/ishtar_common/models_common.py b/ishtar_common/models_common.py index 84b46d2c6..c5c550b5a 100644 --- a/ishtar_common/models_common.py +++ b/ishtar_common/models_common.py @@ -3319,6 +3319,8 @@ class MainItem(ShortMenuItem, SerializeItem): def cascade_update(self, changed=True): if not changed: return + if getattr(self, "_no_down_model_update", False): + return for down_model in self.DOWN_MODEL_UPDATE: if not settings.USE_BACKGROUND_TASK: rel = getattr(self, down_model) @@ -3338,6 +3340,7 @@ class MainItem(ShortMenuItem, SerializeItem): self._external_id_checked = True self._search_updated = True self._no_move = True + self._no_down_model_update = True @classmethod def app_label(cls): -- cgit v1.2.3