forked from DGNum/gestioCOF
more coherent names
This commit is contained in:
parent
790e73d7a4
commit
a63269a4ce
5 changed files with 8 additions and 7 deletions
|
@ -225,7 +225,7 @@ class SpectacleReventeAdmin(admin.ModelAdmin):
|
|||
|
||||
list_display = ("spectacle", "seller", "date", "soldTo")
|
||||
raw_id_fields = ("attribution",)
|
||||
readonly_fields = ("expiration_time",)
|
||||
readonly_fields = ("date_tirage",)
|
||||
search_fields = ['attribution__spectacle__title',
|
||||
'seller__user__username',
|
||||
'seller__user__first_name',
|
||||
|
|
|
@ -31,7 +31,7 @@ class Command(BaseCommand):
|
|||
revente.send_notif()
|
||||
self.stdout.write("Mail d'inscription à une revente envoyé")
|
||||
# Check si tirage à faire
|
||||
elif (now >= revente.expiration_time and
|
||||
elif (now >= revente.date_tirage and
|
||||
not revente.tirage_done):
|
||||
self.stdout.write(str(now))
|
||||
revente.tirage()
|
||||
|
|
|
@ -242,7 +242,8 @@ class SpectacleRevente(models.Model):
|
|||
default=False)
|
||||
|
||||
@property
|
||||
def expiration_time(self):
|
||||
def date_tirage(self):
|
||||
"""Renvoie la date du tirage au sort de la revente."""
|
||||
# L'acheteur doit être connu au plus 12h avant le spectacle
|
||||
remaining_time = (self.attribution.spectacle.date
|
||||
- self.date - timedelta(hours=13))
|
||||
|
@ -251,8 +252,8 @@ class SpectacleRevente(models.Model):
|
|||
# Le vendeur a aussi 1h pour changer d'avis
|
||||
return self.date + delay + timedelta(hours=1)
|
||||
|
||||
def expiration_time_str(self):
|
||||
return self.expiration_time \
|
||||
def date_tirage_str(self):
|
||||
return self.date_tirage \
|
||||
.astimezone(timezone.get_current_timezone()) \
|
||||
.strftime('%d/%m/%y à %H:%M')
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ Bonjour {{ vendeur.first_name }},
|
|||
|
||||
Tu t’es bien inscrit-e pour la revente de {{ spectacle.title }}.
|
||||
|
||||
{% with revente.expiration_time as time %}
|
||||
{% with revente.date_tirage as time %}
|
||||
Le tirage au sort entre tout-e-s les racheteuse-eur-s potentiel-le-s aura lieu
|
||||
le {{ time|date:"DATE_FORMAT" }} à {{ time|time:"TIME_FORMAT" }} (dans {{time|timeuntil }}).
|
||||
Si personne ne s’est inscrit pour racheter la place, celle-ci apparaitra parmi
|
||||
|
|
|
@ -376,7 +376,7 @@ def revente_interested(request, revente_id):
|
|||
revente.answered_mail.add(participant)
|
||||
return render(request, "bda-interested.html",
|
||||
{"spectacle": revente.attribution.spectacle,
|
||||
"date": revente.expiration_time})
|
||||
"date": revente.date_tirage})
|
||||
|
||||
|
||||
@login_required
|
||||
|
|
Loading…
Reference in a new issue