[extensions-web] errorreports: Turn off auto-escaping in emails
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [extensions-web] errorreports: Turn off auto-escaping in emails
- Date: Thu, 1 Dec 2011 03:32:56 +0000 (UTC)
commit fda45ef4419f448c89de5a8431180a8ec62ff64d
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Wed Nov 30 22:32:38 2011 -0500
errorreports: Turn off auto-escaping in emails
sweettooth/errorreports/views.py | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/sweettooth/errorreports/views.py b/sweettooth/errorreports/views.py
index 877e903..2a7dde4 100644
--- a/sweettooth/errorreports/views.py
+++ b/sweettooth/errorreports/views.py
@@ -5,6 +5,7 @@ from django.core.mail import send_mail
from django.core.urlresolvers import reverse
from django.http import HttpResponseForbidden
from django.shortcuts import redirect
+from django.template import Context
from django.template.loader import render_to_string
from errorreports.models import ErrorReport, error_reported
@@ -54,11 +55,13 @@ def send_email_on_error_reported(sender, request, extension, report, **kwargs):
report=report,
url=url)
- subject = render_to_string('errorreports/report_mail_subject.txt', data).strip()
+ subject = render_to_string('errorreports/report_mail_subject.txt', data, Context(autoescape=False))
+ subject = subject.strip()
subject = subject.replace('\n', '')
subject = subject.replace('\r', '')
- message = render_to_string('errorreports/report_mail.txt', data).strip()
+ message = render_to_string('errorreports/report_mail.txt', data, Context(autoescape=False))
+ message = message.strip()
send_mail(subject=subject,
message=message,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]