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
This commit is contained in:
PCoder 2018-04-16 01:26:19 +02:00
parent 6d6a8ea597
commit 8e28756bd8

View file

@ -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'],