Fix in error_reporting

This commit is contained in:
Antonio de la Rosa 2018-06-15 00:04:52 +02:00
parent 49fafab88f
commit e632432886

View file

@ -4,6 +4,12 @@
from settings import config from settings import config
from paramecio.citoplasma.sendmail import SendMail from paramecio.citoplasma.sendmail import SendMail
import sys, traceback
email_failed=''
if hasattr(config, 'email_failed'):
email_failed=config.email_failed
class ErrorReportingPlugin(object): class ErrorReportingPlugin(object):
@ -25,14 +31,15 @@ class ErrorReportingPlugin(object):
#print('detected error') #print('detected error')
# Send mail with error. # Send mail with error.
"""
if email_failed!='':
sendmail=SendMail() sendmail=SendMail()
sendmail.send(email_failed, [email_failed], 'Hubo un error al añadir el mail a mailchimp', r.text, content_type='plain', attachments=[]) text=traceback.format_exc()
print(post.post['email']+'error in mailchimp: '+r.text)
sendmail.send(email_failed, [email_failed], 'Error reporting from site', text, content_type='plain', attachments=[])
rv = callback(*args, **kwargs)
"""
raise raise
#return rv #return rv