[yocto] [layerindex-web][PATCH 1/3] views: fix regression in publish email sending code

Paul Eggleton paul.eggleton at linux.intel.com
Fri May 4 04:55:25 PDT 2018


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 <yi.zhao at windriver.com> for pointing this out.

Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>
---
 layerindex/views.py | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/layerindex/views.py b/layerindex/views.py
index c84982ae..bc3cddfa 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]))
-- 
2.14.3



More information about the yocto mailing list