forked from DGNum/gestioCOF
fix reinit
This commit is contained in:
parent
5e848e4442
commit
7ec6d23987
3 changed files with 5 additions and 2 deletions
|
@ -68,7 +68,7 @@ class AnnulForm(forms.Form):
|
|||
self.fields['attributions'].queryset = participant.attribution_set\
|
||||
.filter(spectacle__date__gte=timezone.now(),
|
||||
revente__isnull=False,
|
||||
revente__date__gte=timezone.now()-timedelta(hours=1))\
|
||||
revente__date__gt=timezone.now()-timedelta(hours=1))\
|
||||
.filter(Q(revente__soldTo__isnull=True) |
|
||||
Q(revente__soldTo=participant))
|
||||
|
||||
|
|
|
@ -223,6 +223,7 @@ class SpectacleRevente(models.Model):
|
|||
answered_mail = models.ManyToManyField(Participant,
|
||||
related_name="wanted",
|
||||
blank=True)
|
||||
|
||||
seller = models.ForeignKey(Participant,
|
||||
related_name="original_shows",
|
||||
verbose_name="Vendeur")
|
||||
|
|
|
@ -333,7 +333,9 @@ def revente(request, tirage_id):
|
|||
revente = rev.get()
|
||||
revente.date = timezone.now() - timedelta(hours=1)
|
||||
revente.soldTo = None
|
||||
revente.answered_mail = None
|
||||
if revente.answered_mail:
|
||||
revente.answered_mail.clear()
|
||||
revente.save()
|
||||
|
||||
else:
|
||||
resellform = ResellForm(participant, prefix='resell')
|
||||
|
|
Loading…
Reference in a new issue