forked from DGNum/gestioCOF
more coherent names
This commit is contained in:
parent
0f01c33267
commit
77511d8acd
2 changed files with 10 additions and 10 deletions
|
@ -161,7 +161,7 @@ class Participant(models.Model):
|
|||
blank=True)
|
||||
tirage = models.ForeignKey(Tirage)
|
||||
choicesrevente = models.ManyToManyField(Spectacle,
|
||||
related_name="revente",
|
||||
related_name="subscribed",
|
||||
blank=True)
|
||||
|
||||
def __str__(self):
|
||||
|
@ -220,9 +220,9 @@ class SpectacleRevente(models.Model):
|
|||
related_name="revente")
|
||||
date = models.DateTimeField("Date de mise en vente",
|
||||
default=timezone.now)
|
||||
interested = models.ManyToManyField(Participant,
|
||||
related_name="wanted",
|
||||
blank=True)
|
||||
answered_mail = models.ManyToManyField(Participant,
|
||||
related_name="wanted",
|
||||
blank=True)
|
||||
seller = models.ForeignKey(Participant,
|
||||
related_name="original_shows",
|
||||
verbose_name="Vendeur")
|
||||
|
@ -262,7 +262,7 @@ class SpectacleRevente(models.Model):
|
|||
verbose_name = "Revente"
|
||||
|
||||
def send_notif(self):
|
||||
inscrits = self.attribution.spectacle.revente.select_related('user')
|
||||
inscrits = self.attribution.spectacle.subscribed.select_related('user')
|
||||
|
||||
mails_to_send = []
|
||||
mail_object = "%s" % (self.attribution.spectacle)
|
||||
|
@ -283,7 +283,7 @@ class SpectacleRevente(models.Model):
|
|||
self.save()
|
||||
|
||||
def mail_shotgun(self):
|
||||
inscrits = self.attribution.spectacle.revente.select_related('user')
|
||||
inscrits = self.attribution.spectacle.subscribed.select_related('user')
|
||||
|
||||
mails_to_send = []
|
||||
mail_object = "%s" % (self.attribution.spectacle)
|
||||
|
@ -304,7 +304,7 @@ class SpectacleRevente(models.Model):
|
|||
self.save()
|
||||
|
||||
def tirage(self):
|
||||
inscrits = self.interested
|
||||
inscrits = self.answered_mail
|
||||
spectacle = self.attribution.spectacle
|
||||
seller = self.seller
|
||||
if inscrits.exists():
|
||||
|
|
|
@ -333,7 +333,7 @@ def revente(request, tirage_id):
|
|||
revente = rev.get()
|
||||
revente.date = timezone.now() - timedelta(hours=1)
|
||||
revente.soldTo = None
|
||||
revente.interested = None
|
||||
revente.answered_mail = None
|
||||
|
||||
else:
|
||||
resellform = ResellForm(participant, prefix='resell')
|
||||
|
@ -367,7 +367,7 @@ def revente_interested(request, revente_id):
|
|||
if timezone.now() < revente.date + timedelta(hours=1) or revente.shotgun:
|
||||
return render(request, "bda-wrongtime.html", {})
|
||||
|
||||
revente.interested.add(participant)
|
||||
revente.answered_mail.add(participant)
|
||||
return render(request, "bda-interested.html",
|
||||
{"spectacle": revente.attribution.spectacle,
|
||||
"date": revente.expiration_time})
|
||||
|
@ -409,7 +409,7 @@ def list_revente(request, tirage_id):
|
|||
if revente.shotgun and not revente.soldTo:
|
||||
deja_revente = True
|
||||
else:
|
||||
revente.interested.add(participant)
|
||||
revente.answered_mail.add(participant)
|
||||
break
|
||||
else:
|
||||
form = InscriptionReventeForm(
|
||||
|
|
Loading…
Reference in a new issue