Unverified Commit 0cbfe89c authored by Thom Wiggers's avatar Thom Wiggers 📐

Context must be a dict

Get rid of Context() in events/views.py and newsletters/views.py
parent 00db2daa
......@@ -7,7 +7,6 @@ from django.contrib.auth.decorators import login_required, permission_required
from django.core.mail import EmailMessage
from django.http import HttpResponse, HttpResponseRedirect, JsonResponse
from django.shortcuts import get_object_or_404, redirect, render
from django.template import Context
from django.template.loader import get_template
from django.utils import timezone, translation
from django.utils.text import slugify
......@@ -249,11 +248,11 @@ def registration(request, event_id, action=None):
subject = _("[THALIA] Notification about your "
"registration for '{}'").format(
event.title)
text_message = text_template.render(Context({
text_message = text_template.render({
'event': event,
'registration': first_waiting,
'member': first_waiting_member
}))
})
waiting_list_notification = EmailMessage(
subject,
......
......@@ -5,7 +5,6 @@ from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.auth.decorators import permission_required
from django.core.mail import EmailMultiAlternatives
from django.shortcuts import get_object_or_404, redirect, render
from django.template import Context
from django.template.loader import get_template
from django.utils import translation
from django.utils.translation import activate, get_language_info
......@@ -76,7 +75,7 @@ def admin_send(request, pk):
subject = '[THALIA] ' + newsletter.title
context = Context({
context = {
'newsletter': newsletter,
'agenda_events': (
newsletter.newslettercontent_set
......@@ -86,7 +85,7 @@ def admin_send(request, pk):
'main_partner': main_partner,
'lang_code': language[0],
'request': request
})
}
html_message = html_template.render(context)
text_message = text_template.render(context)
......
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