AAfghahi commented on code in PR #19929:
URL: https://github.com/apache/superset/pull/19929#discussion_r865431751


##########
superset/utils/core.py:
##########
@@ -928,9 +928,12 @@ def send_email_smtp(  # pylint: 
disable=invalid-name,too-many-arguments,too-many
     # Attach any inline images, which may be required for display in
     # HTML content (inline)
     for msgid, imgdata in (images or {}).items():
-        image = MIMEImage(imgdata)
+        formatted_time = formatdate(localtime=True)
+        file_name = f"{subject} {formatted_time}"
+        image = MIMEImage(imgdata, name=file_name)
         image.add_header("Content-ID", "<%s>" % msgid)
         image.add_header("Content-Disposition", "inline")
+        image.add_header("Content-Disposition", 'attachment; filename="%s"' % 
file_name)

Review Comment:
   Ok, I tested, and the add_header line seems inconsequential to the process 
that we want, so I deleted it. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to