diff --git a/bda/views.py b/bda/views.py index f4495f55..2161b682 100644 --- a/bda/views.py +++ b/bda/views.py @@ -306,7 +306,17 @@ def revente(request, tirage_id): def spectacle(request, tirage_id, spectacle_id): tirage = get_object_or_404(Tirage, id=tirage_id) spectacle = get_object_or_404(Spectacle, id = spectacle_id, tirage=tirage) - return render(request, "bda-emails.html", {"spectacle": spectacle}) + attributions = spectacle.attribues.all() + participants = [] + for attrib in attributions: + participant = attrib.participant + if (participant in participants): + participant.nb_places = 2 + else: + participant.nb_places = 1 + participants.append(participant) + + return render(request, "bda-participants.html", {"spectacle": spectacle, "participants": participants}) class SpectacleListView(ListView):