Merge pull request #20525 from mathieumd/19818-hide_primary_ip_at_vm_creation

Fixes #19818: Hide IP fields when creating VM
This commit is contained in:
bctiemann 2025-10-09 17:54:22 -04:00 committed by GitHub
commit dbc71158ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 4 deletions

View File

@ -280,10 +280,8 @@ class VirtualMachineForm(TenancyForm, NetBoxModelForm):
else:
# An object that doesn't exist yet can't have any IPs assigned to it
self.fields['primary_ip4'].choices = []
self.fields['primary_ip4'].widget.attrs['readonly'] = True
self.fields['primary_ip6'].choices = []
self.fields['primary_ip6'].widget.attrs['readonly'] = True
self.fields.pop('primary_ip4')
self.fields.pop('primary_ip6')
#