diff --git a/bda/models.py b/bda/models.py index 41550507..5c87be1e 100644 --- a/bda/models.py +++ b/bda/models.py @@ -111,7 +111,7 @@ class Spectacle(models.Model): mail_object = "%s - %s - %s" % (self.title, self.date_no_seconds(), self.location) for member in members.values(): - mail_body = loader.render_to_string('mail-rappel.txt', { + mail_body = loader.render_to_string('bda/mails/rappel.txt', { 'name': member[0], 'nb_attr': member[1], 'show': self}) @@ -271,7 +271,7 @@ class SpectacleRevente(models.Model): mails_to_send = [] mail_object = "%s" % (self.attribution.spectacle) for participant in inscrits: - mail_body = loader.render_to_string('mail-revente.txt', { + mail_body = loader.render_to_string('bda/mails/revente.txt', { 'user': participant.user, 'spectacle': self.attribution.spectacle, 'revente': self, @@ -295,7 +295,7 @@ class SpectacleRevente(models.Model): mails_to_send = [] mail_object = "%s" % (self.attribution.spectacle) for participant in inscrits: - mail_body = loader.render_to_string('mail-shotgun.txt', { + mail_body = loader.render_to_string('bda/mails/shotgun.txt', { 'user': participant.user, 'spectacle': self.attribution.spectacle, 'domain': Site.objects.get_current(), @@ -332,14 +332,14 @@ class SpectacleRevente(models.Model): } mails.append(mail.EmailMessage( mail_subject, - loader.render_to_string('mail-revente-winner.txt', context), + loader.render_to_string('bda/mails/revente-winner.txt', context), from_email=settings.MAIL_DATA['revente']['FROM'], to=[winner.user.email], reply_to=[seller.user.email], )) mails.append(mail.EmailMessage( mail_subject, - loader.render_to_string('mail-revente-seller.txt', context), + loader.render_to_string('bda/mails/revente-seller.txt', context), from_email=settings.MAIL_DATA['revente']['FROM'], to=[seller.user.email], reply_to=[winner.user.email], @@ -350,7 +350,7 @@ class SpectacleRevente(models.Model): if inscrit == winner: continue - mail_body = loader.render_to_string('mail-revente-loser.txt', { + mail_body = loader.render_to_string('bda/mails/revente-loser.txt', { 'acheteur': inscrit.user, 'vendeur': seller.user, 'spectacle': spectacle, diff --git a/bda/templates/mail-rappel.txt b/bda/templates/bda/mails/rappel.txt similarity index 100% rename from bda/templates/mail-rappel.txt rename to bda/templates/bda/mails/rappel.txt diff --git a/bda/templates/mail-revente-loser.txt b/bda/templates/bda/mails/revente-loser.txt similarity index 100% rename from bda/templates/mail-revente-loser.txt rename to bda/templates/bda/mails/revente-loser.txt diff --git a/bda/templates/mail-revente-new.txt b/bda/templates/bda/mails/revente-new.txt similarity index 100% rename from bda/templates/mail-revente-new.txt rename to bda/templates/bda/mails/revente-new.txt diff --git a/bda/templates/mail-revente-seller.txt b/bda/templates/bda/mails/revente-seller.txt similarity index 100% rename from bda/templates/mail-revente-seller.txt rename to bda/templates/bda/mails/revente-seller.txt diff --git a/bda/templates/mail-revente-winner.txt b/bda/templates/bda/mails/revente-winner.txt similarity index 100% rename from bda/templates/mail-revente-winner.txt rename to bda/templates/bda/mails/revente-winner.txt diff --git a/bda/templates/mail-revente.txt b/bda/templates/bda/mails/revente.txt similarity index 100% rename from bda/templates/mail-revente.txt rename to bda/templates/bda/mails/revente.txt diff --git a/bda/templates/mail-shotgun.txt b/bda/templates/bda/mails/shotgun.txt similarity index 100% rename from bda/templates/mail-shotgun.txt rename to bda/templates/bda/mails/shotgun.txt diff --git a/bda/views.py b/bda/views.py index ddc0596e..fb183d6c 100644 --- a/bda/views.py +++ b/bda/views.py @@ -305,7 +305,7 @@ def revente(request, tirage_id): revente.seller = participant revente.date = timezone.now() mail_subject = "BdA-Revente : {:s}".format(attribution.spectacle.title) - mail_body = loader.render_to_string('mail-revente-new.txt', { + mail_body = loader.render_to_string('bda/mails/revente-new.txt', { 'vendeur': participant.user, 'spectacle': attribution.spectacle, 'revente': revente, @@ -571,11 +571,11 @@ def send_rappel(request, spectacle_id): # Mails d'exemples fake_member = request.user fake_member.nb_attr = 1 - exemple_mail_1place = loader.render_to_string('mail-rappel.txt', { + exemple_mail_1place = loader.render_to_string('bda/mails/rappel.txt', { 'member': fake_member, 'show': show}) fake_member.nb_attr = 2 - exemple_mail_2places = loader.render_to_string('mail-rappel.txt', { + exemple_mail_2places = loader.render_to_string('bda/mails/rappel.txt', { 'member': fake_member, 'show': show}) # Contexte