From 9660fc0ac57390572ed31ba595b7bc74cd492834 Mon Sep 17 00:00:00 2001 From: vapao Date: Sun, 12 Sep 2021 14:50:24 +0800 Subject: [PATCH] fix issue --- spug_api/apps/host/add.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spug_api/apps/host/add.py b/spug_api/apps/host/add.py index 601d5bb..dad4b75 100644 --- a/spug_api/apps/host/add.py +++ b/spug_api/apps/host/add.py @@ -57,9 +57,9 @@ def cloud_import(request): HostExtend.objects.filter(instance_id=instance_id).update(**item) else: if form.host_type == 'public': - hostname = public_ips[0] if public_ips else None + hostname = public_ips[0] if public_ips else '' else: - hostname = private_ips[0] if private_ips else None + hostname = private_ips[0] if private_ips else '' host = Host.objects.create( name=host_name, hostname=hostname,