communication: fix attachments in email queue and generated reports

so, apparently i messed up some things that were responsible for handling file attachments in email queue and attached on-the-fly generated reports. these issues should be fixed now.

Signed-off-by: Chinmay Pai <chinmaydpai@gmail.com>
This commit is contained in:
Chinmay Pai 2018-12-06 18:12:34 +05:30
parent edaeaec5f3
commit ba0045ef1f
No known key found for this signature in database
GPG key ID: 75507BE256F40CED
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -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,