[FIX] email_template: do not try to add user signature if none set
authorDenis Ledoux <dle@odoo.com>
Tue, 14 Oct 2014 11:41:52 +0000 (13:41 +0200)
committerDenis Ledoux <dle@odoo.com>
Tue, 14 Oct 2014 11:41:52 +0000 (13:41 +0200)
append_content_to_html expects two strings. If the user has no signature, it returns user.signature returns False

addons/email_template/email_template.py

index 335b67f..c5e24b0 100644 (file)
@@ -319,7 +319,8 @@ class email_template(osv.osv):
                                                  or False
         if template.user_signature:
             signature = self.pool.get('res.users').browse(cr, uid, uid, context).signature
-            values['body_html'] = tools.append_content_to_html(values['body_html'], signature)
+            if signature:
+                values['body_html'] = tools.append_content_to_html(values['body_html'], signature)
 
         if values['body_html']:
             values['body'] = tools.html_sanitize(values['body_html'])