From 07f920976fd0ac6d11b16559c363e5a78ee0228d Mon Sep 17 00:00:00 2001 From: Ludovic Stephan Date: Wed, 21 Dec 2016 00:45:30 -0200 Subject: [PATCH] change soldTo functioning --- bda/forms.py | 5 ++--- bda/views.py | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bda/forms.py b/bda/forms.py index fe20e565..352914e4 100644 --- a/bda/forms.py +++ b/bda/forms.py @@ -68,9 +68,8 @@ class AnnulForm(forms.Form): self.fields['attributions'].queryset = participant.attribution_set\ .filter(spectacle__date__gte=timezone.now(), revente__isnull=False, - revente__date__gt=timezone.now()-timedelta(hours=1))\ - .filter(Q(revente__soldTo__isnull=True) | - Q(revente__soldTo=participant)) + revente__date__gt=timezone.now()-timedelta(hours=1), + revente__soldTo__isnull=True) class InscriptionReventeForm(forms.Form): diff --git a/bda/views.py b/bda/views.py index 58c54a01..fbfd9bcd 100644 --- a/bda/views.py +++ b/bda/views.py @@ -285,6 +285,7 @@ def revente(request, tirage_id): if not created: revente.seller = participant revente.date = timezone.now() + revente.soldTo = None revente.notif_sent = False revente.tirage_done = False revente.shotgun = False @@ -337,6 +338,7 @@ def revente(request, tirage_id): revente.soldTo = None revente.notif_sent = False revente.tirage_done = False + revente.shotgun = False if revente.answered_mail: revente.answered_mail.clear() revente.save()