Commit 534da663 authored by Daniel W Bond's avatar Daniel W Bond
Browse files

yet another django 1.11 change-- this time, dictionaries do not have to be...

yet another django 1.11 change-- this time, dictionaries do not have to be retyped as Context objects
parent c5bffaca
...@@ -25,7 +25,7 @@ from ratelimit.decorators import ratelimit ...@@ -25,7 +25,7 @@ from ratelimit.decorators import ratelimit
from .models import Student, Major, Confirmation from .models import Student, Major, Confirmation
from .forms import StudentUpdateForm, FarewellFeedbackForm from .forms import StudentUpdateForm, FarewellFeedbackForm
from housing.models import Room from housing.models import Room
from core.utils import shadowbanning, on_the_same_floor, pk_or_none from core.utils import shadowbanning, on_the_same_floor, pk_or_none, create_email
# details about the student # details about the student
......
...@@ -7,7 +7,6 @@ from django.http import HttpResponseRedirect ...@@ -7,7 +7,6 @@ from django.http import HttpResponseRedirect
from django.contrib import messages from django.contrib import messages
from django.utils.safestring import mark_safe from django.utils.safestring import mark_safe
from django.template.loader import get_template from django.template.loader import get_template
from django.template import Context
from django.core.mail import EmailMultiAlternatives from django.core.mail import EmailMultiAlternatives
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
# third party imports # third party imports
...@@ -70,13 +69,11 @@ def create_email(text_path, html_path, subject, to, context): ...@@ -70,13 +69,11 @@ def create_email(text_path, html_path, subject, to, context):
text_email = get_template(text_path) text_email = get_template(text_path)
html_email = get_template(html_path) html_email = get_template(html_path)
email_context = Context(context)
from_email, cc = ('noreply@srct.gmu.edu', from_email, cc = ('noreply@srct.gmu.edu',
'') '')
text_content = text_email.render(email_context) text_content = text_email.render(context)
html_content = html_email.render(email_context) html_content = html_email.render(context)
msg = EmailMultiAlternatives(subject, text_content, from_email, [to], [cc]) msg = EmailMultiAlternatives(subject, text_content, from_email, [to], [cc])
# mime multipart requires attaching text and html in this order # mime multipart requires attaching text and html in this order
......
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