From 50431542f8cac7fbe24f9136329e428be829f0f6 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Sat, 2 Sep 2017 20:42:58 +0200 Subject: [PATCH] Corrected getting VM name in template --- hosting/templates/hosting/emails/new_booked_vm.html | 5 +++-- hosting/templates/hosting/emails/new_booked_vm.txt | 4 ++-- hosting/views.py | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/hosting/templates/hosting/emails/new_booked_vm.html b/hosting/templates/hosting/emails/new_booked_vm.html index 00430dd5..864cf813 100644 --- a/hosting/templates/hosting/emails/new_booked_vm.html +++ b/hosting/templates/hosting/emails/new_booked_vm.html @@ -3,8 +3,9 @@ {% block email_head %}{{page_header}}{% endblock %} {% block email_body %} {% url 'hosting:orders' order.id as order_url %} -{% blocktrans %}You have ordered a new virtual machine!
-Your order of [{{vm|get_value_from_dict:'name'}}] has been charged.

+{% blocktrans with vm.name as vm_name %}You have ordered a new virtual machine! +
+Your order of [{{vm_name}}] has been charged.

You can view your invoice by clicking the button below.

{% endblocktrans %}
diff --git a/hosting/templates/hosting/emails/new_booked_vm.txt b/hosting/templates/hosting/emails/new_booked_vm.txt index 3c8b06ad..3e90569d 100644 --- a/hosting/templates/hosting/emails/new_booked_vm.txt +++ b/hosting/templates/hosting/emails/new_booked_vm.txt @@ -2,8 +2,8 @@ {% load i18n %} {% block email_head %}{{page_header}}{% endblock %} {% block email_body %} -{% blocktrans %}You have ordered a new virtual machine! -Your order of [{{vm|get_value_from_dict:'name'}}] has been charged. +{% blocktrans with vm.name as vm_name %}You have ordered a new virtual machine! +Your order of [{{vm_name}}] has been charged. You can view your invoice by clicking the link below. diff --git a/hosting/views.py b/hosting/views.py index 465b8419..128bd4db 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -668,7 +668,7 @@ class PaymentVMView(LoginRequiredMixin, FormView): 'context': context, 'template_name': 'new_booked_vm', 'template_path': 'hosting/emails/', - 'from_email': settings.DCL_SUPPORT_FROM_ADDRESS, + 'from_address': settings.DCL_SUPPORT_FROM_ADDRESS, } email = BaseEmail(**email_data) email.send()