Merge pull request #649 from pcoder/bug/5308/correct_ipv6_vm_name

Bug/5308/Correct IPv6 VM name
This commit is contained in:
Pcoder 2018-08-07 22:28:37 +02:00 committed by GitHub
commit e16aab6951
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -162,7 +162,10 @@ class VirtualMachineSerializer(serializers.Serializer):
return '-' return '-'
def get_name(self, obj): def get_name(self, obj):
if obj.name.startswith('public-'):
return obj.name.lstrip('public-') return obj.name.lstrip('public-')
else:
return obj.name
class VMTemplateSerializer(serializers.Serializer): class VMTemplateSerializer(serializers.Serializer):