diff --git a/frappe/core/doctype/communication/email.py b/frappe/core/doctype/communication/email.py index 4864dd12c2..091adc3b4b 100755 --- a/frappe/core/doctype/communication/email.py +++ b/frappe/core/doctype/communication/email.py @@ -280,7 +280,7 @@ def prepare_to_notify(doc, print_html=None, print_format=None, attachments=None) # is it a filename? try: # keep this for error handling - _file = frappe.get_doc("File", {"file_name": a}) + _file = frappe.get_doc("File", a) _file.get_content() # these attachments will be attached on-demand # and won't be stored in the message diff --git a/frappe/email/queue.py b/frappe/email/queue.py index 07433ed715..eb8edd8e2a 100755 --- a/frappe/email/queue.py +++ b/frappe/email/queue.py @@ -537,7 +537,7 @@ def prepare_message(email, recipient, recipients_list): fid = attachment.get("fid") if fid: - _file = frappe.get_doc("File", {"file_name": fid}) + _file = frappe.get_doc("File", fid) fcontent = _file.get_content() attachment.update({ 'fname': _file.file_name,