From 853b98d3c3fb41e32355618ff21fa659c8c6b5a5 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Fri, 13 Jan 2017 18:03:52 +0530 Subject: [PATCH] [Fix] Add attached documents in the attachments folder --- frappe/core/doctype/communication/email.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/frappe/core/doctype/communication/email.py b/frappe/core/doctype/communication/email.py index 7f713284c0..e03a190770 100755 --- a/frappe/core/doctype/communication/email.py +++ b/frappe/core/doctype/communication/email.py @@ -336,12 +336,13 @@ def add_attachments(name, attachments): # loop through attachments for a in attachments: - attach = frappe.db.get_value("File", {"name":a}, - ["file_name", "file_url", "is_private"], as_dict=1) + if isinstance(a, basestring): + attach = frappe.db.get_value("File", {"name":a}, + ["file_name", "file_url", "is_private"], as_dict=1) - # save attachments to new doc - save_url(attach.file_url, attach.file_name, "Communication", name, - "Home/Attachments", attach.is_private) + # save attachments to new doc + save_url(attach.file_url, attach.file_name, "Communication", name, + "Home/Attachments", attach.is_private) def filter_email_list(doc, email_list, exclude, is_cc=False): # temp variables