From 8723715ffd39b8dbabafd24dac8a3149d7744c8b 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') diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py index 861558c09..210fd7996 100644 --- a/archaeological_context_records/models.py +++ b/archaeological_context_records/models.py @@ -479,7 +479,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