From 8e28756bd8f78328f8d7e32f786c715f715ac569 Mon Sep 17 00:00:00 2001 From: PCoder Date: Mon, 16 Apr 2018 01:26:19 +0200 Subject: [PATCH] Check if we have total_price (indicates that we have VAT excluded price);hence,use it as final_price. if not use the previous casei and use it as final_price. If not use the preivous case --- datacenterlight/tasks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/datacenterlight/tasks.py b/datacenterlight/tasks.py index 5ba6e066..869cf1f8 100644 --- a/datacenterlight/tasks.py +++ b/datacenterlight/tasks.py @@ -56,7 +56,8 @@ def create_vm_task(self, vm_template_id, user, specs, template, "Running create_vm_task on {}".format(current_task.request.hostname)) vm_id = None try: - final_price = specs.get('price') + final_price = (specs.get('total_price') if 'total_price' in specs + else specs.get('price')) billing_address = BillingAddress( cardholder_name=billing_address_data['cardholder_name'], street_address=billing_address_data['street_address'],