do partial upsert (#44992)

This commit is contained in:
Emmanuel Cazenave 2020-07-09 18:23:18 +02:00
parent 9a8042b141
commit c4826ee499
1 changed files with 7 additions and 1 deletions

View File

@ -420,7 +420,13 @@ query getDossiers($demarcheNumber: Int!, $createdSince: ISO8601DateTime, $first:
setattr(entreprise, attr, value)
except Entreprise.DoesNotExist:
entreprise = Entreprise(resource=self, **row)
entreprise.save()
try:
with transaction.atomic():
entreprise.save()
except Exception:
self.logger.error("Partial upsert on dossier %s" % ds_dossier.pk)
pass
return res