From a3180fa479a9bf541b3158f100f22d8d6351b88c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Fri, 8 Jul 2016 20:33:26 +0200 Subject: [PATCH] =?UTF-8?q?Pr=C3=A9vient=20plus=20t=C3=B4t=20qu'un=20tirag?= =?UTF-8?q?e=20ne=20peut=20=C3=AAtre=20lanc=C3=A9.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GestioCOF ne présente pas le formulaire pour la graine du tirage si l'attribut `enable_do_tirage` du tirage est à `False`. --- bda/views.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bda/views.py b/bda/views.py index f97a6c70..39ed17e2 100644 --- a/bda/views.py +++ b/bda/views.py @@ -181,8 +181,6 @@ 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) @@ -251,6 +249,9 @@ def do_tirage(request, tirage_id): @buro_required def 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}) if request.POST: form = TokenForm(request.POST) if form.is_valid():