From ed83965a368a006deac3b3546c86f2bbe14a91ae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Valentin=20Grou=C3=A8s?= <valentin.groues@uni.lu>
Date: Wed, 15 Nov 2017 11:41:39 +0100
Subject: [PATCH] fix issue #165 - error with mail templates for flying team

---
 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 8c3a7fa6..9803905c 100644
--- a/smash/web/models/mail_template.py
+++ b/smash/web/models/mail_template.py
@@ -173,10 +173,10 @@ class MailTemplate(models.Model):
                 "##A_DATE_FULL##": appointment_date_full,
                 "##A_DATE_SHORT##": appointment_date_short,
                 "##A_TIME##": appointment_date_time,
-                "##A_FLYING_TEAM##": appointment.flying_team,
+                "##A_FLYING_TEAM##": str(appointment.flying_team),
                 "##A_STATUS##": appointment.get_status_display(),
                 "##A_LOCATION##": appointment.location.name,
-                "##A_LOCATION_OR_FLYINGTEAM##": appointment.flying_team or appointment.location.name,
+                "##A_LOCATION_OR_FLYINGTEAM##": str(appointment.flying_team) or appointment.location.name,
                 "##A_WORKER##": unicode(appointment.worker_assigned),
                 '##A_WORKER_PHONE##': worker_phone_number,
                 '##A_WORKER_EMAIL##': worker_email_address,
@@ -221,6 +221,6 @@ class MailTemplate(models.Model):
                 "##S_POST_CODE##": subject.postal_code,
                 "##S_SCREENING_NUMBER##": subject.screening_number,
                 "##S_TYPE##": subject.get_type_display(),
-                '##S_MAIL_LANGUAGE##': subject.default_written_communication_language,
+                '##S_MAIL_LANGUAGE##': str(subject.default_written_communication_language),
                 '##S_KNOWN_LANGUAGES##': ", ".join([l.name for l in subject.languages.all()])
             })
-- 
GitLab