From afc4718f2d89bebbb048a50b2e424a1e626e017d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Wed, 15 Jun 2016 22:37:23 +0200 Subject: [PATCH] Formattage et robustesse MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Ajoute des espaces après les `:` dans la déclaration des dictionnaires. - Change le `= 2` et `+= 1` pour rendre le code plus résistant à une éventuelle mise à jour. --- bda/views.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/bda/views.py b/bda/views.py index 2ae72e9c..fd0a0cdc 100644 --- a/bda/views.py +++ b/bda/views.py @@ -296,15 +296,15 @@ def spectacle(request, tirage_id, spectacle_id): participants = {} for attrib in attributions: participant = attrib.participant - participant_info = {'lastname':participant.user.last_name, + 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} + '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 + participants[participant.id]['nb_places'] += 1 else: participants[participant.id] = participant_info