From d760e9f87fe040ab33dcdb942303d39fbf83a9c8 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 17 Mar 2026 17:59:37 +0100 Subject: ⚡️ cache search counts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ishtar_common/models_common.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ishtar_common/models_common.py') diff --git a/ishtar_common/models_common.py b/ishtar_common/models_common.py index c90ca7309..a2708945f 100644 --- a/ishtar_common/models_common.py +++ b/ishtar_common/models_common.py @@ -5145,6 +5145,12 @@ class IdentifierItem(models.Model): super().save(*args, **kwargs) self.regenerate_all_ids() + # search cache clean + SearchCache = apps.get_model("ishtar_common", "SearchCache") + SearchCache.objects.filter( + content_type=ContentType.objects.get_for_model(self.__class__) + ).delete() + def regenerate_all_ids(self, save=True): if getattr(self, "_prevent_loop", False): return {} -- cgit v1.2.3