From a8caa035c090713fdbf5b4c5bf2c5232600c7a4e Mon Sep 17 00:00:00 2001 From: PCoder Date: Tue, 9 Apr 2019 09:12:09 +0200 Subject: [PATCH] Set configuration to empty string if not available --- utils/hosting_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/hosting_utils.py b/utils/hosting_utils.py index ec97a320..ee65fccf 100644 --- a/utils/hosting_utils.py +++ b/utils/hosting_utils.py @@ -47,7 +47,8 @@ def get_or_create_vm_detail(user, manager, vm_id): vm_detail_obj = VMDetail.objects.create( user=user, vm_id=vm_id, disk_size=vm['disk_size'], cores=vm['cores'], memory=vm['memory'], - configuration=vm['configuration'], ipv4=vm['ipv4'], + configuration="" if vm['configuration'] is None else vm['configuration'], + ipv4=vm['ipv4'], ipv6=vm['ipv6'] ) return vm_detail_obj