diff --git a/bda/templates/bda-attrib-extra.html b/bda/templates/bda-attrib-extra.html index 8ffccf34..4286dfc9 100644 --- a/bda/templates/bda-attrib-extra.html +++ b/bda/templates/bda-attrib-extra.html @@ -2,7 +2,7 @@ {% block extracontent %} -
{{ token }}
{{ token }}
Si vous savez ce que vous faites, vous pouvez autoriser le lancement du +tirage dans l'interface admin. +Pensez à le désactiver à nouveau ensuite.
+{% endblock %} diff --git a/bda/views.py b/bda/views.py index 1eab066d..7c10e0f2 100644 --- a/bda/views.py +++ b/bda/views.py @@ -181,11 +181,11 @@ def inscription(request, tirage_id): def do_tirage(request, tirage_id): tirage_elt = get_object_or_404(Tirage, id=tirage_id) + if not tirage_elt.enable_do_tirage: + return render(request, "tirage-failed.html", {'tirage': tirage_elt}) form = TokenForm(request.POST) if not form.is_valid(): return tirage(request) - tirage_elt.token = form.cleaned_data['token'] - tirage_elt.save() start = time.time() data = {} shows = tirage_elt.spectacle_set.select_related().all() @@ -235,16 +235,15 @@ def do_tirage(request, tirage_id): members2 = members2.items() data["members2"] = sorted(members2, key=lambda m: m[0].user.last_name) # À partir d'ici, le tirage devient effectif - # FIXME: Établir les conditions de validations (formulaire ?) - # cf. issue #32 - if False: - Attribution.objects.filter( - spectacle__tirage=tirage_elt - ).delete() - for (show, members, _) in results: - for (member, _, _, _) in members: - attrib = Attribution(spectacle=show, participant=member) - attrib.save() + Attribution.objects.filter(spectacle__tirage=tirage_elt).delete() + tirage_elt.tokens += "%s\n\"\"\"%s\"\"\"\n" % ( + timezone.now().strftime("%y-%m-%d %H:%M:%S"), + form.cleaned_data['token']) + tirage_elt.save() + 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) diff --git a/gestioncof/static/css/cof.css b/gestioncof/static/css/cof.css index d59e6ded..6cbc6c5d 100644 --- a/gestioncof/static/css/cof.css +++ b/gestioncof/static/css/cof.css @@ -246,6 +246,15 @@ fieldset legend { background-color: transparent; } +.important { + font-weight: bold; + color: #F90; +} + +.important a { + color: #F90; +} + #main form ul.errorlist li { font-weight: bold; color: #B00000;