From ebe5633fcd066faec122caf7b3fe9613a10ea641 Mon Sep 17 00:00:00 2001 From: Hugo LEVY-FALK Date: Tue, 3 Jul 2018 21:19:33 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20le=20rechargement=20:=20la=20facture=20es?= =?UTF-8?q?t=20sauvegard=C3=A9e=20avant=20la=20vente.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cotisations/views.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cotisations/views.py b/cotisations/views.py index dc906686..79d989e5 100644 --- a/cotisations/views.py +++ b/cotisations/views.py @@ -826,14 +826,13 @@ def recharge(request): invoice = Facture(user=request.user) invoice.paiement = refill_form.cleaned_data['payment'] invoice.valid = False - purchase = Vente.objects.create( + invoice.save() + Vente.objects.create( facture=invoice, name='solde', prix=refill_form.cleaned_data['value'], number=1 ) - purchase.save() - invoice.save() return invoice.paiement.end_payment(invoice, request) return form({ 'rechargeform': refill_form,