From 675660b5f79c2a5da844364c91958ad109a0a467 Mon Sep 17 00:00:00 2001 From: Grizzly Date: Tue, 20 Aug 2019 20:37:59 +0000 Subject: [PATCH] =?UTF-8?q?Sp=C3=A9cification=20du=20template=20de=20langu?= =?UTF-8?q?e=20[oublie]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tickets/models.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tickets/models.py b/tickets/models.py index 9c21fb74..1f3de941 100644 --- a/tickets/models.py +++ b/tickets/models.py @@ -52,10 +52,17 @@ class Ticket(AclMixin, models.Model): def publish_mail(self): site_url = GeneralOption.objects.first().main_site_url to_addr = Preferences.objects.first().publish_address - template = loader.get_template('tickets/publication_mail') context = Context({'ticket':self,'site_url':site_url}) + + lang = Preferences.objects.first().mail_language + if(lang == 0): + obj = 'Nouvelle ouverture de ticket' + template = loader.get_template('tickets/publication_mail_fr') + else: + obj = 'New ticket opened' + template = loader.get_template('tickets/publication_mail_en') send_mail( - 'Nouvelle ouverture de ticket', + obj, template.render(context), GeneralOption.get_cached_value('email_from'), [to_addr],