forked from DGNum/gestioCOF
change property
This commit is contained in:
parent
bc4b06fc92
commit
4a8d17f354
1 changed files with 4 additions and 4 deletions
|
@ -234,7 +234,8 @@ class SpectacleRevente(models.Model):
|
|||
tirage_done = models.BooleanField("Tirage effectué",
|
||||
default=False)
|
||||
|
||||
def get_expiration_time(self):
|
||||
@property
|
||||
def expiration_time(self):
|
||||
# L'acheteur doit être connu au plus 12h avant le spectacle
|
||||
remaining_time = (self.attribution.spectacle.date
|
||||
- self.date - timedelta(hours=13))
|
||||
|
@ -242,9 +243,9 @@ class SpectacleRevente(models.Model):
|
|||
delay = min(remaining_time, timedelta(days=2))
|
||||
# On a aussi 1h pour changer d'avis
|
||||
return self.date + delay + timedelta(hours=1)
|
||||
expiration_time = property(get_expiration_time)
|
||||
|
||||
def get_shotgun(self):
|
||||
@property
|
||||
def shotgun(self):
|
||||
# Soit on a dépassé le délai du tirage, soit il reste peu de
|
||||
# temps avant le spectacle
|
||||
# On se laisse 5min de marge pour cron
|
||||
|
@ -252,7 +253,6 @@ class SpectacleRevente(models.Model):
|
|||
(self.attribution.spectacle.date <= timezone.now() +
|
||||
timedelta(days=1))) and (timezone.now() >= self.date +
|
||||
timedelta(minutes=15))
|
||||
shotgun = property(get_shotgun)
|
||||
|
||||
def __str__(self):
|
||||
return "%s -- %s" % (self.seller,
|
||||
|
|
Loading…
Reference in a new issue