From 06846661bef14103be5ed11ca6d7f33401a42c78 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Sun, 21 Sep 2025 22:35:16 +0200 Subject: 🐛 import: prevent crash on some unexpected errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ishtar_common/data_importer.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ishtar_common/data_importer.py b/ishtar_common/data_importer.py index 7b652b792..f6e43c683 100644 --- a/ishtar_common/data_importer.py +++ b/ishtar_common/data_importer.py @@ -2209,6 +2209,8 @@ class Importer(object): ) raise IntegrityError(str(e)) # obj = cls.objects.filter(**dct).all()[0] + if not obj and (post_save_keys or m2ms): + raise IntegrityError(f"{cls} not created") for key in post_save_keys: getattr(obj, key)() for attr, value in m2ms: -- cgit v1.2.3