Enregistrement des opérations dans K-Psul

- Ajout d'une transaction pour tous les save lors d'une commande K-Psul
  afin de préserver la cohérence de la BDD
This commit is contained in:
Aurélien Delobelle 2016-08-08 00:13:53 +02:00
parent 4cb89aa005
commit e978209ebc

View file

@ -450,6 +450,10 @@ def kpsul_perform_operations(request):
# Filling cof status for statistics
operationgroup.is_cof = operationgroup.on_acc.is_cof
# Apply all saves in a transaction to ensure database integrity
try:
with transaction.atomic:
# Saving operation group
operationgroup.save()
data['operationgroup'] = operationgroup.pk