diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-10-27 13:55:43 +0200 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-12-12 12:23:19 +0100 | 
| commit | 05f0ac85283d1e9b2ceddab525a293c03906abc4 (patch) | |
| tree | 63b34c04e9adf4088384240cbf50500bfc26d2fc /archaeological_context_records/models.py | |
| parent | e269e7ac5e93cd9f5cee1930f10ccbc0d8932e4b (diff) | |
| download | Ishtar-05f0ac85283d1e9b2ceddab525a293c03906abc4.tar.bz2 Ishtar-05f0ac85283d1e9b2ceddab525a293c03906abc4.zip  | |
Geodata save: transaction for main_geodata assignation to limit deadlocks
Diffstat (limited to 'archaeological_context_records/models.py')
| -rw-r--r-- | archaeological_context_records/models.py | 4 | 
1 files changed, 2 insertions, 2 deletions
diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py index 55b101acc..09733b566 100644 --- a/archaeological_context_records/models.py +++ b/archaeological_context_records/models.py @@ -25,7 +25,7 @@ from django.conf import settings  from django.contrib.gis.db import models  from django.contrib.postgres.indexes import GinIndex  from django.contrib.sites.models import Site -from django.db import connection, IntegrityError, transaction +from django.db import connection, transaction, OperationalError, IntegrityError  from django.db.models import Q  from django.db.models.signals import post_delete, post_save, m2m_changed  from django.urls import reverse @@ -461,7 +461,7 @@ class GeographicSubTownItem(GeoItem):                  # multiple save, post treatments can cause synchronous add                  with transaction.atomic():                      self.geodata.add(town.main_geodata) -            except IntegrityError: +            except (OperationalError, IntegrityError):                  pass          if save:              post_save_geo(self.__class__, instance=self, created=False,  | 
