Ce serveur Gitlab sera éteint le 30 juin 2020, pensez à migrer vos projets vers les serveurs gitlab-research.centralesupelec.fr et gitlab-student.centralesupelec.fr !

Commit 477aab3a authored by Levy--Falk Hugo's avatar Levy--Falk Hugo Committed by root

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

parent 827780de
......@@ -687,6 +687,16 @@ def new_facture_solde(request, userid):
@login_required
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)
if f.is_valid():
facture = Facture(user=request.user)
......@@ -701,7 +711,6 @@ def recharge(request):
number=1,
)
v.save()
options, _created = AssoOption.objects.get_or_create()
content = payment.PAYMENT_SYSTEM[options.payment](facture, request)
return render(request, 'cotisations/payment.html', content)
return form({'rechargeform':f}, 'cotisations/recharge.html', request)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment