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)