Commit ca856c2e authored by Samuel GAIST's avatar Samuel GAIST Committed by Andre Anjos

[accounts][migrations] Replace use of Context by dict

parent b968b343
......@@ -30,7 +30,6 @@ from __future__ import unicode_literals
from django.db.models import Q
from django.core.urlresolvers import reverse
from django.template import loader
from django.template import Context
from django.conf import settings
from django.db import migrations, models
......@@ -71,23 +70,21 @@ def set_profile_state(apps, schema_editor):
parsed_url = urlparse(settings.URL_PREFIX)
server_address = '%s://%s' % (parsed_url.scheme, parsed_url.hostname)
c = Context({ 'user': user,
'prefix': server_address,
})
context = {
'user': user,
'prefix': server_address,
}
try:
t = loader.get_template('registration/mail.migration_10_accounts.subject.txt')
subject = t.render(c)
t = loader.get_template('registration/mail.migration_10_accounts.subject.txt')
subject = t.render(c)
# Note: e-mail subject *must not* contain newlines
subject = settings.EMAIL_SUBJECT_PREFIX + ''.join(subject.splitlines())
# Note: e-mail subject *must not* contain newlines
subject = settings.EMAIL_SUBJECT_PREFIX + ''.join(subject.splitlines())
t = loader.get_template('registration/mail.migration_10_accounts.message.txt')
message = t.render(c)
t = loader.get_template('registration/mail.migration_10_accounts.message.txt')
message = t.render(c)
send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, [user.email])
except:
pass
send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, [user.email])
user.profile.supervision_key = None
......
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