Fix flake8 by reverting a previous commit

This commit is contained in:
Eric Rasche
2016-04-13 16:32:37 +00:00
parent 5923a67301
commit a6d95d0909
+5 -4
View File
@@ -1228,10 +1228,6 @@ def send_mail( frm, to, subject, body, config, html=None ):
:param html: Alternative HTML representation of the body content. If
provided will convert the message to a MIMEMultipart. (Default 'None')
"""
if config.smtp_server is None:
log.error( "Mail is not configured for this Galaxy instance." )
log.info( msg )
return
to = listify( to )
if html is None:
@@ -1243,6 +1239,11 @@ def send_mail( frm, to, subject, body, config, html=None ):
msg[ 'From' ] = frm
msg[ 'Subject' ] = subject
if config.smtp_server is None:
log.error( "Mail is not configured for this Galaxy instance." )
log.info( msg )
return
if html is not None:
mp_text = email_mime_text.MIMEText( body.encode( 'ascii', 'replace' ), 'plain' )
mp_html = email_mime_text.MIMEText( html.encode( 'ascii', 'replace' ), 'html' )