mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-09 01:49:35 -06:00
Merge pull request #20525 from mathieumd/19818-hide_primary_ip_at_vm_creation
Some checks failed
CI / build (20.x, 3.12) (push) Has been cancelled
CodeQL / Analyze (${{ matrix.language }}) (none, actions) (push) Waiting to run
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Waiting to run
CodeQL / Analyze (${{ matrix.language }}) (none, python) (push) Waiting to run
CI / build (20.x, 3.10) (push) Has been cancelled
CI / build (20.x, 3.11) (push) Has been cancelled
Some checks failed
CI / build (20.x, 3.12) (push) Has been cancelled
CodeQL / Analyze (${{ matrix.language }}) (none, actions) (push) Waiting to run
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Waiting to run
CodeQL / Analyze (${{ matrix.language }}) (none, python) (push) Waiting to run
CI / build (20.x, 3.10) (push) Has been cancelled
CI / build (20.x, 3.11) (push) Has been cancelled
Fixes #19818: Hide IP fields when creating VM
This commit is contained in:
commit
dbc71158ec
@ -280,10 +280,8 @@ class VirtualMachineForm(TenancyForm, NetBoxModelForm):
|
|||||||
else:
|
else:
|
||||||
|
|
||||||
# An object that doesn't exist yet can't have any IPs assigned to it
|
# An object that doesn't exist yet can't have any IPs assigned to it
|
||||||
self.fields['primary_ip4'].choices = []
|
self.fields.pop('primary_ip4')
|
||||||
self.fields['primary_ip4'].widget.attrs['readonly'] = True
|
self.fields.pop('primary_ip6')
|
||||||
self.fields['primary_ip6'].choices = []
|
|
||||||
self.fields['primary_ip6'].widget.attrs['readonly'] = True
|
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user