From ff68769c5a4254bd4391adfa3672c05a6ee4a502 Mon Sep 17 00:00:00 2001 From: Hugo LEVY-FALK Date: Sat, 27 Jan 2018 00:32:13 +0100 Subject: [PATCH] =?UTF-8?q?Affiche=20le=20rechargement=20si=20le=20moyen?= =?UTF-8?q?=20de=20paiement=20est=20d=C3=A9fini.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- users/templates/users/profil.html | 2 +- users/views.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/users/templates/users/profil.html b/users/templates/users/profil.html index f56ed99e..8d72b983 100644 --- a/users/templates/users/profil.html +++ b/users/templates/users/profil.html @@ -132,7 +132,7 @@ with this program; if not, write to the Free Software Foundation, Inc., Aucun {% endif %} - {% if user_solde %} + {% if allow_online_payment %} Solde {{ users.solde }} € diff --git a/users/views.py b/users/views.py index e3f73f38..c8c340b9 100644 --- a/users/views.py +++ b/users/views.py @@ -85,7 +85,7 @@ from users.forms import ( ) from cotisations.models import Facture from machines.models import Machine -from preferences.models import OptionalUser, GeneralOption +from preferences.models import OptionalUser, GeneralOption, AssoOption from re2o.views import form from re2o.utils import ( @@ -782,6 +782,8 @@ def profil(request, users, userid): ) options, _created = OptionalUser.objects.get_or_create() user_solde = options.user_solde + options, _created = AssoOption.objects.get_or_create() + allow_online_payment = options.payment != 'NONE' return render( request, 'users/profil.html', @@ -792,6 +794,7 @@ def profil(request, users, userid): 'ban_list': bans, 'white_list': whitelists, 'user_solde': user_solde, + 'allow_online_payment' : allow_online_payment, } )