Corrige la liste des impayés dans bda

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
This commit is contained in:
Martin Pépin 2016-06-17 02:05:05 +02:00
parent f00e081b0b
commit 2b43db8a79
2 changed files with 3 additions and 1 deletions

View file

@ -4,4 +4,5 @@
<h2>Impayés</h2> <h2>Impayés</h2>
<textarea style="width: 100%; height: 100px; margin-top: 10px;"> <textarea style="width: 100%; height: 100px; margin-top: 10px;">
{% for participant in unpaid %}{{ participant.user.email }}, {% endfor %}</textarea> {% for participant in unpaid %}{{ participant.user.email }}, {% endfor %}</textarea>
<h3>Total&#8239;:&#8239;{{ unpaid|length }}</h3>
{% endblock %} {% endblock %}

View file

@ -330,7 +330,8 @@ class SpectacleListView(ListView):
def unpaid(request, tirage_id): def unpaid(request, tirage_id):
tirage = get_object_or_404(Tirage, id=tirage_id) tirage = get_object_or_404(Tirage, id=tirage_id)
unpaid = tirage.participant_set.filter(paid=False).all() 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 @buro_required
def liste_spectacles_ics(request, tirage_id): def liste_spectacles_ics(request, tirage_id):