Commit f565bab9 authored by fred's avatar fred

1.11: use dictionary as context

parent 29ee9325
......@@ -14,7 +14,7 @@ import html2text
from django.db import models
from django.core.urlresolvers import reverse
from django.template import loader, Context
from django.template import loader,
from django.template.loader import render_to_string
from django.conf import settings
......@@ -45,7 +45,7 @@ class Subscriber(models.Model) :
self.password = hashlib.sha1(str(random.random())).hexdigest()
confirm_subject = loader.get_template('newsletter/confirmation_email_subject.txt')
confirm_body = loader.get_template('newsletter/confirmation_email_body.txt')
context = Context({'token': self.password})
context = {'token': self.password}
send_mail(confirm_subject.render(context).strip(), confirm_body.render(context),
settings.NEWSLETTER_SENDER, [self.email])
self.is_validated = False
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment