make error email content_type configurable

This commit is contained in:
Lance Edgar 2012-11-06 08:05:46 -08:00
parent 99bde9e696
commit 1babe591ad

View file

@ -73,6 +73,7 @@ def email_exception(type=None, value=None, traceback=None):
}
body, ctype = render_exception(data)
ctype = edbob.config.get('edbob.errors', 'content_type', default=ctype)
sendmail_with_config('errors', body, content_type=ctype)
@ -90,7 +91,7 @@ def render_exception(data):
# Assume Mako template; render and return.
from mako.template import Template
template = Template(filename=template)
return template.render(**data), 'text/plain'
return template.render(**data), 'text/html'
# If not a Mako template, return regular text with substitutions.
body = StringIO()