From 1b37eed53da0fcbf26e01f5c4c7f44e0075d849d Mon Sep 17 00:00:00 2001 From: PCoder Date: Mon, 16 Apr 2018 01:29:07 +0200 Subject: [PATCH] Include pricing_name in the email sent to admin --- datacenterlight/tasks.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/datacenterlight/tasks.py b/datacenterlight/tasks.py index 869cf1f8..df91387e 100644 --- a/datacenterlight/tasks.py +++ b/datacenterlight/tasks.py @@ -19,6 +19,8 @@ from utils.forms import UserBillingAddressForm from utils.mailer import BaseEmail from utils.models import BillingAddress +from .models import VMPricing + logger = get_task_logger(__name__) @@ -137,6 +139,10 @@ def create_vm_task(self, vm_template_id, user, specs, template, 'vm_id': vm['vm_id'], 'order_id': order.id } + if 'pricing_name' in specs: + context['pricing'] = str(VMPricing.get_vm_pricing_by_name( + name=specs['pricing_name'] + )) email_data = { 'subject': settings.DCL_TEXT + " Order from %s" % context['email'], 'from_email': settings.DCL_SUPPORT_FROM_ADDRESS,