Browse Source

Fix, the mail title cause an unexpected error

tr4ck3ur 2 years ago
parent
commit
a378555846
1 changed files with 4 additions and 5 deletions
  1. 4 5
      jm2l/__init__.py

+ 4 - 5
jm2l/__init__.py

@@ -41,13 +41,12 @@ def mailer_tasks(config):
41 41
         
42 42
         # Prepare Plain Text Message :
43 43
         Mail_template = Template(filename='jm2l/templates/mail_plain.mako')
44
-        mail_plain = Mail_template.render(request=request, User=StaffUser, Contact=Contact, action="Tasks", output_encoding='ascii',)
44
+        mail_plain = Mail_template.render(request=request, User=StaffUser, Contact=Contact, action="Tasks")
45 45
         # Prepare HTML Message :
46 46
         Mail_template = Template(filename='jm2l/templates/mail_html.mako')
47
-        mail_html = Mail_template.render(request=request, User=StaffUser, Contact=Contact, action="Tasks", output_encoding='ascii',)
48
-        
47
+        mail_html = Mail_template.render(request=request, User=StaffUser, Contact=Contact, action="Tasks")
49 48
         # Prepare Message
50
-        message = Message(subject="[JM2L] Rappel des Tâches pour les JM2L",
49
+        message = Message(subject="[JM2L] Rappel des Tâches pour les JM2L".decode('utf-8'),
51 50
                           sender="contact@jm2l.linux-azur.org",
52 51
                           recipients=[StaffUser.mail],
53 52
                           body=mail_plain, html=mail_html)
@@ -93,7 +92,7 @@ def main(global_config, **settings):
93 92
     config.add_static_view('vendor', 'static/vendor', cache_max_age=3600)
94 93
     config.add_static_view('upload', 'upload', cache_max_age=3600)
95 94
     config.add_static_view('resources', 'resources', cache_max_age=3600)
96
-       
95
+    
97 96
     # ICal Routes
98 97
     config.add_route('progr_iCal', '/{year:\d+}/JM2L.ics')
99 98