forked from DGNum/gestioCOF
Corrections dans les mails de revente
- full_name -> first_name - Date - Url
This commit is contained in:
parent
5499c22b36
commit
dff0b3ffdd
3 changed files with 22 additions and 7 deletions
|
@ -8,6 +8,7 @@ import calendar
|
|||
import random
|
||||
from datetime import timedelta
|
||||
|
||||
from django.contrib.sites.models import Site
|
||||
from django.db import models
|
||||
from django.contrib.auth.models import User
|
||||
from django.template import loader, Context
|
||||
|
@ -244,6 +245,11 @@ class SpectacleRevente(models.Model):
|
|||
# On a aussi 1h pour changer d'avis
|
||||
return self.date + delay + timedelta(hours=1)
|
||||
|
||||
def expiration_time_str(self):
|
||||
return self.expiration_time \
|
||||
.astimezone(timezone.get_current_timezone()) \
|
||||
.strftime('%D à %H:%M')
|
||||
|
||||
@property
|
||||
def shotgun(self):
|
||||
# Soit on a dépassé le délai du tirage, soit il reste peu de
|
||||
|
@ -270,7 +276,8 @@ class SpectacleRevente(models.Model):
|
|||
mail_body = render_template('mail-revente.txt', {
|
||||
'user': participant.user,
|
||||
'spectacle': self.attribution.spectacle,
|
||||
'revente': self})
|
||||
'revente': self,
|
||||
'domain': Site.objects.get_current().domain})
|
||||
mail_tot = mail.EmailMessage(
|
||||
mail_object, mail_body,
|
||||
settings.REVENTE_FROM, [participant.user.email],
|
||||
|
@ -291,6 +298,7 @@ class SpectacleRevente(models.Model):
|
|||
mail_body = render_template('mail-shotgun.txt', {
|
||||
'user': participant.user,
|
||||
'spectacle': self.attribution.spectacle,
|
||||
'domain': Site.objects.get_current(),
|
||||
'mail': self.attribution.participant.user.email})
|
||||
mail_tot = mail.EmailMessage(
|
||||
mail_object, mail_body,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue