From f7f8f7493bb12987ed57f0a812d8c7f336246dc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Kervella?= Date: Sun, 15 Apr 2018 13:34:51 +0000 Subject: [PATCH] Fix : various little things --- cotisations/templates/cotisations/facture.html | 6 ++++-- cotisations/views.py | 2 +- re2o/acl.py | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cotisations/templates/cotisations/facture.html b/cotisations/templates/cotisations/facture.html index d708b407..dc8648ac 100644 --- a/cotisations/templates/cotisations/facture.html +++ b/cotisations/templates/cotisations/facture.html @@ -34,6 +34,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% csrf_token %} + {% if articlesformset %}

{% trans "Invoice's articles" %}

{{ articlesformset.management_form }} @@ -54,11 +55,12 @@ with this program; if not, write to the Free Software Foundation, Inc., Total price : 0,00 € {% endblocktrans %}

+ {% endif %} {% bootstrap_form factureform %} {% bootstrap_button action_name button_type='submit' icon='star' %} - +{% if articlesformset %} - +{% endif %} {% endblock %} diff --git a/cotisations/views.py b/cotisations/views.py index 5687a0fa..78ee0d74 100644 --- a/cotisations/views.py +++ b/cotisations/views.py @@ -489,7 +489,7 @@ def add_paiement(request): # TODO : chnage paiement to Payment @login_required @can_edit(Paiement) -def edit_paiement(request, paiement_instance, *_kwargs): +def edit_paiement(request, paiement_instance, **_kwargs): """ View used to edit a payment method. """ diff --git a/re2o/acl.py b/re2o/acl.py index 0acc710a..6ab34350 100644 --- a/re2o/acl.py +++ b/re2o/acl.py @@ -171,13 +171,13 @@ def can_delete_set(model): all_objects = model.objects.all() instances_id = [] for instance in all_objects: - can, msg = instance.can_delete(request.user) + can, _msg = instance.can_delete(request.user) if can: instances_id.append(instance.id) instances = model.objects.filter(id__in=instances_id) if not instances: messages.error( - request, msg or "Vous ne pouvez pas accéder à ce menu") + request, "Vous ne pouvez pas accéder à ce menu") return redirect(reverse( 'users:profil', kwargs={'userid': str(request.user.id)}