forked from DGNum/gestioCOF
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:
parent
4cb89aa005
commit
e978209ebc
1 changed files with 12 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue