From 61b32b483d30463238a9649c3ba08e8d11011a56 Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Fri, 4 May 2018 17:21:38 +1200 Subject: [PATCH] views: fix regression in publish email sending code In e902b67bccddf34d8bbd65ad6c81d078e945ebb8 I missed a couple of Context usages in the layer publish view and the result was that it broke publishing a layer (and apparently I didn't run a final test on that, shame on me). Thanks to Yi Zhao for pointing this out. Signed-off-by: Paul Eggleton --- layerindex/views.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/layerindex/views.py b/layerindex/views.py index c84982a..bc3cddf 100644 --- a/layerindex/views.py +++ b/layerindex/views.py @@ -20,7 +20,6 @@ from django.db import transaction from django.contrib.auth.models import User, Permission from django.db.models import Q, Count, Sum from django.template.loader import get_template -from django.template import Context from django.utils.decorators import method_decorator from django.contrib.auth.decorators import login_required from django.contrib import messages @@ -277,19 +276,19 @@ def publish_view(request, name): break # create subject from subject template - d = Context({ + d = { 'layer_name': layeritem.name, 'site_name': request.META['HTTP_HOST'], - }) + } subject = subjecttext.render(d).rstrip() #create body from body template - d = Context({ + d = { 'maintainers': maintainer_names, 'layer_name': layeritem.name, 'layer_url': layer_url, 'help_contact': help_contact, - }) + } body = bodytext.render(d) tasks.send_email.apply_async((subject, body, from_email, [m.email for m in maintainers]))