From 76a88be4ef729d32e4e2b29d5f05fdd20886fd93 Mon Sep 17 00:00:00 2001 From: Ludovic Stephan Date: Tue, 8 Nov 2016 10:28:00 -0200 Subject: [PATCH] check date spectacle --- bda/views.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/bda/views.py b/bda/views.py index b9ce0825..9b667cc2 100644 --- a/bda/views.py +++ b/bda/views.py @@ -331,11 +331,12 @@ def revente(request, tirage_id): id=revente_id) if rev.exists(): revente = rev.get() - revente.date = timezone.now() - timedelta(hours=1) - revente.soldTo = None - if revente.answered_mail: - revente.answered_mail.clear() - revente.save() + if revente.attribution.spectacle.date > timezone.now(): + revente.date = timezone.now() - timedelta(hours=1) + revente.soldTo = None + if revente.answered_mail: + revente.answered_mail.clear() + revente.save() else: resellform = ResellForm(participant, prefix='resell')