Merge branch 'Aufinal/liste_spectacles' into Aufinal/view_spectacles

This commit is contained in:
ludo 2016-06-15 20:36:00 +02:00
commit 732f4b247d
4 changed files with 17 additions and 27 deletions

View file

@ -298,14 +298,13 @@ def spectacle(request, tirage_id, spectacle_id):
participants = {}
for attrib in attributions:
participant = attrib.participant
participant.given = attrib.given
if (participant.id in participants):
participants[participant.id].nb_places = 2
participant_info = {'lastname':participant.user.last_name, 'name': participant.user.get_full_name, 'username':participant.user.username, 'email':participant.user.email, 'given':attrib.given, 'paid':participant.paid, 'nb_places':1}
if participant.id in participants:
participants[participant.id]['nb_places'] = 2
else:
participant.nb_places = 1
participants[participant.id]=participant
participants[participant.id] = participant_info
return render(request, "bda-participants.html", {"spectacle": spectacle, "participants": participants.values()})
return render(request, "bda-participants.html", {"spectacle": spectacle, "participants": sorted(participants.values(), key=lambda part: part['lastname'])})
@buro_required
def add_attrib(request, tirage_id, spectacle_id):