mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 20:59:01 +02:00
views: fix regression in publish email sending code
In e902b67bcc
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@windriver.com> for pointing this out.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
parent
b4cfb049d9
commit
61b32b483d
|
@ -20,7 +20,6 @@ from django.db import transaction
|
||||||
from django.contrib.auth.models import User, Permission
|
from django.contrib.auth.models import User, Permission
|
||||||
from django.db.models import Q, Count, Sum
|
from django.db.models import Q, Count, Sum
|
||||||
from django.template.loader import get_template
|
from django.template.loader import get_template
|
||||||
from django.template import Context
|
|
||||||
from django.utils.decorators import method_decorator
|
from django.utils.decorators import method_decorator
|
||||||
from django.contrib.auth.decorators import login_required
|
from django.contrib.auth.decorators import login_required
|
||||||
from django.contrib import messages
|
from django.contrib import messages
|
||||||
|
@ -277,19 +276,19 @@ def publish_view(request, name):
|
||||||
break
|
break
|
||||||
|
|
||||||
# create subject from subject template
|
# create subject from subject template
|
||||||
d = Context({
|
d = {
|
||||||
'layer_name': layeritem.name,
|
'layer_name': layeritem.name,
|
||||||
'site_name': request.META['HTTP_HOST'],
|
'site_name': request.META['HTTP_HOST'],
|
||||||
})
|
}
|
||||||
subject = subjecttext.render(d).rstrip()
|
subject = subjecttext.render(d).rstrip()
|
||||||
|
|
||||||
#create body from body template
|
#create body from body template
|
||||||
d = Context({
|
d = {
|
||||||
'maintainers': maintainer_names,
|
'maintainers': maintainer_names,
|
||||||
'layer_name': layeritem.name,
|
'layer_name': layeritem.name,
|
||||||
'layer_url': layer_url,
|
'layer_url': layer_url,
|
||||||
'help_contact': help_contact,
|
'help_contact': help_contact,
|
||||||
})
|
}
|
||||||
body = bodytext.render(d)
|
body = bodytext.render(d)
|
||||||
|
|
||||||
tasks.send_email.apply_async((subject, body, from_email, [m.email for m in maintainers]))
|
tasks.send_email.apply_async((subject, body, from_email, [m.email for m in maintainers]))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user