Skip to content

Commit dbc7115

Browse files
authored
Merge pull request #20525 from mathieumd/19818-hide_primary_ip_at_vm_creation
Fixes #19818: Hide IP fields when creating VM
2 parents f052361 + d8e4c95 commit dbc7115

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

netbox/virtualization/forms/model_forms.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,8 @@ def __init__(self, *args, **kwargs):
280280
else:
281281

282282
# An object that doesn't exist yet can't have any IPs assigned to it
283-
self.fields['primary_ip4'].choices = []
284-
self.fields['primary_ip4'].widget.attrs['readonly'] = True
285-
self.fields['primary_ip6'].choices = []
286-
self.fields['primary_ip6'].widget.attrs['readonly'] = True
283+
self.fields.pop('primary_ip4')
284+
self.fields.pop('primary_ip6')
287285

288286

289287
#

0 commit comments

Comments
 (0)