added notification template handling in result_notification_prepare

This commit is contained in:
Brian Rosner 2012-09-08 16:35:38 -06:00
parent 5f8e8f195c
commit 1f9ceed0e1

View file

@ -396,6 +396,12 @@ def result_notification_prepare(request, section_slug, status):
if request.method != "POST": if request.method != "POST":
return HttpResponseNotAllowed(["POST"]) return HttpResponseNotAllowed(["POST"])
notification_template_pk = request.POST.get("notification_template", "")
if notification_template_pk:
notification_template = NotificationTemplate.objects.get(pk=notification_template_pk)
else:
notification_template = None
proposal_pks = [] proposal_pks = []
try: try:
for pk in request.POST.getlist("_selected_action"): for pk in request.POST.getlist("_selected_action"):
@ -413,6 +419,7 @@ def result_notification_prepare(request, section_slug, status):
ctx = { ctx = {
"section_slug": section_slug, "section_slug": section_slug,
"status": status, "status": status,
"notification_template": notification_template,
"proposals": proposals, "proposals": proposals,
"proposal_pks": " ".join([str(pk) for pk in proposal_pks]), "proposal_pks": " ".join([str(pk) for pk in proposal_pks]),
} }