From 2b43db8a79b916d10311ac8d7907402ec252c74f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Fri, 17 Jun 2016 02:05:05 +0200 Subject: [PATCH] =?UTF-8?q?Corrige=20la=20liste=20des=20impay=C3=A9s=20dan?= =?UTF-8?q?s=20bda?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit La liste des gens n'ayant pas payé leur places pour un tirage ne contient plus les participants n'ayant pas eu de place. Ajoute un compte des impayés dans le template. Fixes 43 --- bda/templates/bda-unpaid.html | 1 + bda/views.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bda/templates/bda-unpaid.html b/bda/templates/bda-unpaid.html index 5596dd82..df30cfd3 100644 --- a/bda/templates/bda-unpaid.html +++ b/bda/templates/bda-unpaid.html @@ -4,4 +4,5 @@

Impayés

+

Total : {{ unpaid|length }}

{% endblock %} diff --git a/bda/views.py b/bda/views.py index fd0a0cdc..9b0323ce 100644 --- a/bda/views.py +++ b/bda/views.py @@ -330,7 +330,8 @@ class SpectacleListView(ListView): def unpaid(request, tirage_id): tirage = get_object_or_404(Tirage, id=tirage_id) unpaid = tirage.participant_set.filter(paid=False).all() - return render(request, "bda-unpaid.html", {"unpaid": unpaid}) + really_unpaid = [part for part in unpaid if part.attribution_set.all()] + return render(request, "bda-unpaid.html", {"unpaid": really_unpaid}) @buro_required def liste_spectacles_ics(request, tirage_id):