From 5b90f3f5324c5871bd4e8fb6bbf7ad82b2d6ae38 Mon Sep 17 00:00:00 2001 From: Mathieu Clabaut Date: Wed, 9 Dec 2015 14:44:42 +0100 Subject: [PATCH] Convert attachments to a list if necessary. Also corrects a typo that was apparently silenced by the bug. This closes issue #1123 --- gluon/tools.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gluon/tools.py b/gluon/tools.py index 5009e3b3..e55b7da4 100644 --- a/gluon/tools.py +++ b/gluon/tools.py @@ -523,6 +523,7 @@ class Mail(object): payload_in.attach(attachment) else: payload_in.attach(attachments) + attachments = [attachments] ####################################################### # CIPHER # @@ -779,7 +780,7 @@ class Mail(object): attachments = attachments and [mail.Attachment( a.my_filename, a.my_payload, - contebt_id='' % k + content_id='' % k ) for k, a in enumerate(attachments) if not raw] if attachments: result = mail.send_mail(