From dfd4fb7d835362e69b4ac72a4267f5bf5a888965 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Sun, 5 Jun 2016 13:59:24 +0200 Subject: [PATCH] Tirage utilisable et plus joli MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Ajout de balises `
` pour mettre en valeur le token
- On remplace la condition sur les utilisateurs par le décorateur
  `@buro_required`
---
 bda/templates/bda-attrib-extra.html |  3 ++-
 bda/templates/bda-attrib.html       |  3 ++-
 bda/views.py                        | 14 +++++++-------
 3 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/bda/templates/bda-attrib-extra.html b/bda/templates/bda-attrib-extra.html
index c2c266d2..8ffccf34 100644
--- a/bda/templates/bda-attrib-extra.html
+++ b/bda/templates/bda-attrib-extra.html
@@ -3,7 +3,8 @@
 {% block extracontent %}
 
 

Attribution (détails)

-

Token : {{ token }}

+

Token :

+
{{ token }}

Placés : {{ total_slots }} ; Déçus : {{ total_losers }}

diff --git a/bda/templates/bda-attrib.html b/bda/templates/bda-attrib.html index 22f5786a..f0bfd955 100644 --- a/bda/templates/bda-attrib.html +++ b/bda/templates/bda-attrib.html @@ -8,7 +8,8 @@ {% block realcontent %}

Attribution

-

Token : {{ token }}

+

Token :

+
{{ token }}

Placés : {{ total_slots }} ; Déçus : {{ total_losers }}

{% if user.profile.is_buro %}

Déficit total: {{ total_deficit }} €, Opéra: {{ opera_deficit }} €, Attribué: {{ total_sold }} €

{% endif %}

Temps de calcul : {{ duration|floatformat }}s

diff --git a/bda/views.py b/bda/views.py index 0789b9ff..7cec5001 100644 --- a/bda/views.py +++ b/bda/views.py @@ -214,17 +214,17 @@ def do_tirage(request, tirage_id): member.total += show.price members2 = members2.items() data["members2"] = sorted(members2, key=lambda m: m[0].user.last_name) - if False and request.user.username in ["seguin", "harazi","fromherz", "ccadiou"]: - Attribution.objects.all().delete() - for (show, members, _) in results: - for (member, _, _, _) in members: - attrib = Attribution(spectacle=show, participant=member) - attrib.save() + # À partir d'ici, le tirage devient effectif + Attribution.objects.all().delete() + for (show, members, _) in results: + for (member, _, _, _) in members: + attrib = Attribution(spectacle=show, participant=member) + attrib.save() return render(request, "bda-attrib-extra.html", data) else: return render(request, "bda-attrib.html", data) -@login_required +@buro_required def tirage(request, tirage_id): if request.POST: form = TokenForm(request.POST)