[extensions-web] django: context_instance in render_to_string() is deprecated.



commit 0422b2a55ddcdadb8518c19b626b91f8632ce4cb
Author: Yuri Konotopov <ykonotopov gnome org>
Date:   Sat Dec 1 23:54:20 2018 +0400

    django: context_instance in render_to_string() is deprecated.
    
    TODO: need to review escaping in emails, but looks like unaffected.

 sweettooth/errorreports/views.py | 6 ++++--
 sweettooth/review/views.py       | 5 +++--
 2 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/sweettooth/errorreports/views.py b/sweettooth/errorreports/views.py
index 5039a61..45b55b2 100644
--- a/sweettooth/errorreports/views.py
+++ b/sweettooth/errorreports/views.py
@@ -63,12 +63,14 @@ 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, Context(autoescape=False))
+    # TODO: review autoescape
+    subject = render_to_string('errorreports/report_mail_subject.txt', data)
     subject = subject.strip()
     subject = subject.replace('\n', '')
     subject = subject.replace('\r', '')
 
-    message = render_to_string('errorreports/report_mail.txt', data, Context(autoescape=False))
+    # TODO: review autoescape
+    message = render_to_string('errorreports/report_mail.txt', data)
     message = message.strip()
 
     send_mail(subject=subject,
diff --git a/sweettooth/review/views.py b/sweettooth/review/views.py
index 2231a08..425a968 100644
--- a/sweettooth/review/views.py
+++ b/sweettooth/review/views.py
@@ -294,8 +294,9 @@ def render_mail(version, template, data):
     subject_template = 'review/%s_mail_subject.txt' % (template,)
     body_template = 'review/%s_mail.txt' % (template,)
 
-    subject = render_to_string(subject_template, data, Context(autoescape=False))
-    body = render_to_string(body_template, data, Context(autoescape=False))
+    # TODO: review autoescape
+    subject = render_to_string(subject_template, data)
+    body = render_to_string(body_template, data)
 
     references = "<%s-review-v%d extensions gnome org>" % (extension.uuid, version.version)
     headers = {'In-Reply-To': references,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]