forked from DGNum/gestioCOF
change soldTo functioning
This commit is contained in:
parent
38dd220c23
commit
07f920976f
2 changed files with 4 additions and 3 deletions
|
@ -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):
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue