8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-26 06:32:26 +00:00

Pouvoir prendre de l'argent c'est bien. En prendre seulement si on veut, c'est mieux.

This commit is contained in:
Hugo LEVY-FALK 2018-01-27 13:52:36 +01:00 committed by root
parent 827780def3
commit 477aab3a7f

View file

@ -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)