mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-22 19:33:11 +00:00
Pouvoir prendre de l'argent c'est bien. En prendre seulement si on veut, c'est mieux.
This commit is contained in:
parent
827780def3
commit
477aab3a7f
1 changed files with 10 additions and 1 deletions
|
@ -687,6 +687,16 @@ def new_facture_solde(request, userid):
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
def recharge(request):
|
def recharge(request):
|
||||||
|
options, _created = AssoOption.objects.get_or_create()
|
||||||
|
if options.payment == 'NONE':
|
||||||
|
messages.error(
|
||||||
|
request,
|
||||||
|
"Le paiement en ligne est désactivé."
|
||||||
|
)
|
||||||
|
return redirect(reverse(
|
||||||
|
'users:profil',
|
||||||
|
kwargs={'userid': request.user.id}
|
||||||
|
))
|
||||||
f = RechargeForm(request.POST or None, user=request.user)
|
f = RechargeForm(request.POST or None, user=request.user)
|
||||||
if f.is_valid():
|
if f.is_valid():
|
||||||
facture = Facture(user=request.user)
|
facture = Facture(user=request.user)
|
||||||
|
@ -701,7 +711,6 @@ def recharge(request):
|
||||||
number=1,
|
number=1,
|
||||||
)
|
)
|
||||||
v.save()
|
v.save()
|
||||||
options, _created = AssoOption.objects.get_or_create()
|
|
||||||
content = payment.PAYMENT_SYSTEM[options.payment](facture, request)
|
content = payment.PAYMENT_SYSTEM[options.payment](facture, request)
|
||||||
return render(request, 'cotisations/payment.html', content)
|
return render(request, 'cotisations/payment.html', content)
|
||||||
return form({'rechargeform':f}, 'cotisations/recharge.html', request)
|
return form({'rechargeform':f}, 'cotisations/recharge.html', request)
|
||||||
|
|
Loading…
Reference in a new issue