From 2a1c870caced65ba5de587dcb40f65db00327f8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Mon, 6 Jun 2016 19:22:01 +0200 Subject: [PATCH] =?UTF-8?q?Emp=C3=AAche=20l'inscription=20=C3=A0=20un=20ti?= =?UTF-8?q?rage=20non=20ouvert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bda/views.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bda/views.py b/bda/views.py index 4939e2db..bf9e438b 100644 --- a/bda/views.py +++ b/bda/views.py @@ -126,6 +126,12 @@ def places_ics(request, tirage_id): @cof_required def inscription(request, tirage_id): tirage = get_object_or_404(Tirage, id=tirage_id) + if timezone.now() < tirage.ouverture: + error_desc = "Ouverture le %s" % ( + tirage.ouverture.strftime('%d %b %Y à %H:%M')) + return render(request, 'resume_inscription.html', + { "error_title": "Le tirage n'est pas encore ouvert !", + "error_description": error_desc }) if timezone.now() > tirage.fermeture: participant, created = Participant.objects.get_or_create( user=request.user, tirage=tirage)