make error email content_type configurable
This commit is contained in:
parent
99bde9e696
commit
1babe591ad
1 changed files with 2 additions and 1 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue