[damned-lies] Template rendering takes a simple dict now
- From: Claude Paroz <claudep src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [damned-lies] Template rendering takes a simple dict now
- Date: Wed, 18 May 2016 19:10:48 +0000 (UTC)
commit 77fad157468901908cc807052dca15bc360c13d0
Author: Claude Paroz <claude 2xlibre net>
Date: Wed May 18 20:58:55 2016 +0200
Template rendering takes a simple dict now
stats/utils.py | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/stats/utils.py b/stats/utils.py
index 4a284a3..9454575 100644
--- a/stats/utils.py
+++ b/stats/utils.py
@@ -35,7 +35,6 @@ from django.conf import settings
from django.contrib.sites.models import Site
from django.core.files.base import File
from django.core.mail import send_mail
-from django.template import Context
from django.template.loader import get_template
from django.utils import six
from django.utils.encoding import force_bytes, force_text
@@ -553,12 +552,12 @@ def notify_list(branch, diff):
"""Send notification about string changes described in diff."""
current_site = Site.objects.get_current()
template = get_template('freeze-notification.txt')
- text = template.render(Context({
- 'module' : '%s.%s' % (branch.module.name, branch.name),
- 'ourweb' : current_site.domain,
- 'potdiff' : force_text("\n ".join(diff)),
+ text = template.render({
+ 'module': '%s.%s' % (branch.module.name, branch.name),
+ 'ourweb': current_site.domain,
+ 'potdiff': force_text("\n ".join(diff)),
'commit_log': branch.get_vcs_web_log_url(),
- }))
+ })
send_mail(subject="String additions to '%s.%s'" % (branch.module.name, branch.name),
message=text,
from_email="GNOME Status Pages <%s>" % (settings.DEFAULT_FROM_EMAIL),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]