From 45be5cbe8059b29a988a8c488014ea3032851a75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Grou=C3=A8s?= <valentin.groues@uni.lu> Date: Thu, 18 May 2017 12:00:20 +0200 Subject: [PATCH] fix an issue with non ascii characters --- smash/web/models/mail_template.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/smash/web/models/mail_template.py b/smash/web/models/mail_template.py index 8e0316a9..a7de8d66 100644 --- a/smash/web/models/mail_template.py +++ b/smash/web/models/mail_template.py @@ -148,7 +148,7 @@ class MailTemplate(models.Model): replacements.update({ "##DATE_FULL##": current_datetime.strftime(DATE_FORMAT_FULL), "##DATE_SHORT##": current_datetime.strftime(DATE_FORMAT_SHORT), - "##WORKER##": str(worker) + "##WORKER##": unicode(worker) }) def _add_appointment_replacements(self, replacements, appointment): @@ -173,7 +173,7 @@ class MailTemplate(models.Model): "##A_STATUS##": appointment.get_status_display(), "##A_LOCATION##": appointment.location.name, "##A_LOCATION_OR_FLYINGTEAM##": appointment.flying_team or appointment.location.name, - "##A_WORKER##": str(appointment.worker_assigned), + "##A_WORKER##": unicode(appointment.worker_assigned), '##A_WORKER_PHONE##': worker_phone_number, '##A_WORKER_EMAIL##': worker_email_address, "##A_ROOM##": str(appointment.room), @@ -197,7 +197,7 @@ class MailTemplate(models.Model): else: date_born = None replacements.update({ - "##S_FULL_NAME##": str(subject), + "##S_FULL_NAME##": unicode(subject), "##S_FIRST_NAME##": subject.first_name, "##S_LAST_NAME##": subject.last_name, "##S_ADDRESS##": subject.address, -- GitLab