From 48bfd85f66e4047bee767f1df6d41bdb6aae2ef3 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 31 Jul 2025 13:01:41 +0200 Subject: 🐛 import: force explicitly geo check on post treatments for complex associations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- archaeological_context_records/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'archaeological_context_records/models.py') diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py index 9be9789d9..d9bc520f2 100644 --- a/archaeological_context_records/models.py +++ b/archaeological_context_records/models.py @@ -478,7 +478,10 @@ class GeographicSubTownItem(GeoItem): if main_geodata_id not in self.geodata.values_list("id", flat=True): upper = getattr(self, upper_attr, None) modified = True - self.geodata.add(upper.main_geodata) + try: + self.geodata.add(upper.main_geodata) + except IntegrityError: + pass if not main_item_is_set: if self.main_geodata_id != main_geodata_id: -- cgit v1.2.3