From f48005166e9d78b4b25dd02bb4225f8893fc31ac Mon Sep 17 00:00:00 2001 From: PCoder Date: Sun, 1 Jul 2018 18:42:11 +0200 Subject: [PATCH] Fix bug getting VMTemplate object from vm_template_id --- datacenterlight/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/datacenterlight/utils.py b/datacenterlight/utils.py index 7b3ef73d..3d0e4370 100644 --- a/datacenterlight/utils.py +++ b/datacenterlight/utils.py @@ -54,7 +54,9 @@ def create_vm(billing_address_data, stripe_customer_id, specs, ) order_specs_obj, obj_created = OrderSpecifications.objects.get_or_create( - vm_template=VMTemplate.objects.get(vm_template_id), + vm_template=VMTemplate.objects.get( + opennebula_vm_template_id=vm_template_id + ), cores=specs['cpu'], memory=specs['memory'], ssd_size=specs['disk_size'] ) order.order_specs = order_specs_obj