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)
|
blank=True)
|
||||||
tirage = models.ForeignKey(Tirage)
|
tirage = models.ForeignKey(Tirage)
|
||||||
choicesrevente = models.ManyToManyField(Spectacle,
|
choicesrevente = models.ManyToManyField(Spectacle,
|
||||||
related_name="revente",
|
related_name="subscribed",
|
||||||
blank=True)
|
blank=True)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
@ -220,7 +220,7 @@ class SpectacleRevente(models.Model):
|
||||||
related_name="revente")
|
related_name="revente")
|
||||||
date = models.DateTimeField("Date de mise en vente",
|
date = models.DateTimeField("Date de mise en vente",
|
||||||
default=timezone.now)
|
default=timezone.now)
|
||||||
interested = models.ManyToManyField(Participant,
|
answered_mail = models.ManyToManyField(Participant,
|
||||||
related_name="wanted",
|
related_name="wanted",
|
||||||
blank=True)
|
blank=True)
|
||||||
seller = models.ForeignKey(Participant,
|
seller = models.ForeignKey(Participant,
|
||||||
|
@ -262,7 +262,7 @@ class SpectacleRevente(models.Model):
|
||||||
verbose_name = "Revente"
|
verbose_name = "Revente"
|
||||||
|
|
||||||
def send_notif(self):
|
def send_notif(self):
|
||||||
inscrits = self.attribution.spectacle.revente.select_related('user')
|
inscrits = self.attribution.spectacle.subscribed.select_related('user')
|
||||||
|
|
||||||
mails_to_send = []
|
mails_to_send = []
|
||||||
mail_object = "%s" % (self.attribution.spectacle)
|
mail_object = "%s" % (self.attribution.spectacle)
|
||||||
|
@ -283,7 +283,7 @@ class SpectacleRevente(models.Model):
|
||||||
self.save()
|
self.save()
|
||||||
|
|
||||||
def mail_shotgun(self):
|
def mail_shotgun(self):
|
||||||
inscrits = self.attribution.spectacle.revente.select_related('user')
|
inscrits = self.attribution.spectacle.subscribed.select_related('user')
|
||||||
|
|
||||||
mails_to_send = []
|
mails_to_send = []
|
||||||
mail_object = "%s" % (self.attribution.spectacle)
|
mail_object = "%s" % (self.attribution.spectacle)
|
||||||
|
@ -304,7 +304,7 @@ class SpectacleRevente(models.Model):
|
||||||
self.save()
|
self.save()
|
||||||
|
|
||||||
def tirage(self):
|
def tirage(self):
|
||||||
inscrits = self.interested
|
inscrits = self.answered_mail
|
||||||
spectacle = self.attribution.spectacle
|
spectacle = self.attribution.spectacle
|
||||||
seller = self.seller
|
seller = self.seller
|
||||||
if inscrits.exists():
|
if inscrits.exists():
|
||||||
|
|
|
@ -333,7 +333,7 @@ def revente(request, tirage_id):
|
||||||
revente = rev.get()
|
revente = rev.get()
|
||||||
revente.date = timezone.now() - timedelta(hours=1)
|
revente.date = timezone.now() - timedelta(hours=1)
|
||||||
revente.soldTo = None
|
revente.soldTo = None
|
||||||
revente.interested = None
|
revente.answered_mail = None
|
||||||
|
|
||||||
else:
|
else:
|
||||||
resellform = ResellForm(participant, prefix='resell')
|
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:
|
if timezone.now() < revente.date + timedelta(hours=1) or revente.shotgun:
|
||||||
return render(request, "bda-wrongtime.html", {})
|
return render(request, "bda-wrongtime.html", {})
|
||||||
|
|
||||||
revente.interested.add(participant)
|
revente.answered_mail.add(participant)
|
||||||
return render(request, "bda-interested.html",
|
return render(request, "bda-interested.html",
|
||||||
{"spectacle": revente.attribution.spectacle,
|
{"spectacle": revente.attribution.spectacle,
|
||||||
"date": revente.expiration_time})
|
"date": revente.expiration_time})
|
||||||
|
@ -409,7 +409,7 @@ def list_revente(request, tirage_id):
|
||||||
if revente.shotgun and not revente.soldTo:
|
if revente.shotgun and not revente.soldTo:
|
||||||
deja_revente = True
|
deja_revente = True
|
||||||
else:
|
else:
|
||||||
revente.interested.add(participant)
|
revente.answered_mail.add(participant)
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
form = InscriptionReventeForm(
|
form = InscriptionReventeForm(
|
||||||
|
|
Loading…
Reference in a new issue