From 723a6b14dfa5465f4cf2bde9daa18a8d2fc87a41 Mon Sep 17 00:00:00 2001
From: "piotr.gawron" <piotr.gawron@uni.lu>
Date: Fri, 29 May 2020 14:50:13 +0200
Subject: [PATCH] handle unicode properly

---
 smash/web/models/mail_template.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/smash/web/models/mail_template.py b/smash/web/models/mail_template.py
index 3c3eea5c..e23d67ba 100644
--- a/smash/web/models/mail_template.py
+++ b/smash/web/models/mail_template.py
@@ -327,10 +327,10 @@ class MailTemplate(models.Model):
                 '##S_KNOWN_LANGUAGES##': ", ".join([l.name for l in study_subject.subject.languages.all()])
             }
             if study_subject.health_partner is not None:
-                result["##S_HEALTH_PARTNER_NAME##"] = str(study_subject.health_partner.name)
-                result["##S_HEALTH_PARTNER_ADDRESS##"] = str(study_subject.health_partner.address)
-                result["##S_HEALTH_PARTNER_ZIP_CODE##"] = str(study_subject.health_partner.postal_code)
-                result["##S_HEALTH_PARTNER_CITY##"] = str(study_subject.health_partner.city)
+                result["##S_HEALTH_PARTNER_NAME##"] = unicode(study_subject.health_partner.name)
+                result["##S_HEALTH_PARTNER_ADDRESS##"] = unicode(study_subject.health_partner.address)
+                result["##S_HEALTH_PARTNER_ZIP_CODE##"] = unicode(study_subject.health_partner.postal_code)
+                result["##S_HEALTH_PARTNER_CITY##"] = unicode(study_subject.health_partner.city)
             else:
                 result["##S_HEALTH_PARTNER_NAME##"] = ""
                 result["##S_HEALTH_PARTNER_ADDRESS##"] = ""
-- 
GitLab