mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-22 12:06:53 -06:00
Fixes #14709: Correct typo in TYPE_VIRTUALMACHINE
This commit is contained in:
parent
ea5d33f358
commit
5223486fd8
@ -38,11 +38,11 @@ class TunnelEncapsulationChoices(ChoiceSet):
|
|||||||
class TunnelTerminationTypeChoices(ChoiceSet):
|
class TunnelTerminationTypeChoices(ChoiceSet):
|
||||||
# For TunnelCreateForm
|
# For TunnelCreateForm
|
||||||
TYPE_DEVICE = 'dcim.device'
|
TYPE_DEVICE = 'dcim.device'
|
||||||
TYPE_VIRUTALMACHINE = 'virtualization.virtualmachine'
|
TYPE_VIRTUALMACHINE = 'virtualization.virtualmachine'
|
||||||
|
|
||||||
CHOICES = (
|
CHOICES = (
|
||||||
(TYPE_DEVICE, _('Device')),
|
(TYPE_DEVICE, _('Device')),
|
||||||
(TYPE_VIRUTALMACHINE, _('Virtual Machine')),
|
(TYPE_VIRTUALMACHINE, _('Virtual Machine')),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -157,7 +157,7 @@ class TunnelCreateForm(TunnelForm):
|
|||||||
def __init__(self, *args, initial=None, **kwargs):
|
def __init__(self, *args, initial=None, **kwargs):
|
||||||
super().__init__(*args, initial=initial, **kwargs)
|
super().__init__(*args, initial=initial, **kwargs)
|
||||||
|
|
||||||
if get_field_value(self, 'termination1_type') == TunnelTerminationTypeChoices.TYPE_VIRUTALMACHINE:
|
if get_field_value(self, 'termination1_type') == TunnelTerminationTypeChoices.TYPE_VIRTUALMACHINE:
|
||||||
self.fields['termination1_parent'].label = _('Virtual Machine')
|
self.fields['termination1_parent'].label = _('Virtual Machine')
|
||||||
self.fields['termination1_parent'].queryset = VirtualMachine.objects.all()
|
self.fields['termination1_parent'].queryset = VirtualMachine.objects.all()
|
||||||
self.fields['termination1_termination'].queryset = VMInterface.objects.all()
|
self.fields['termination1_termination'].queryset = VMInterface.objects.all()
|
||||||
@ -168,7 +168,7 @@ class TunnelCreateForm(TunnelForm):
|
|||||||
'virtual_machine_id': '$termination1_parent',
|
'virtual_machine_id': '$termination1_parent',
|
||||||
})
|
})
|
||||||
|
|
||||||
if get_field_value(self, 'termination2_type') == TunnelTerminationTypeChoices.TYPE_VIRUTALMACHINE:
|
if get_field_value(self, 'termination2_type') == TunnelTerminationTypeChoices.TYPE_VIRTUALMACHINE:
|
||||||
self.fields['termination2_parent'].label = _('Virtual Machine')
|
self.fields['termination2_parent'].label = _('Virtual Machine')
|
||||||
self.fields['termination2_parent'].queryset = VirtualMachine.objects.all()
|
self.fields['termination2_parent'].queryset = VirtualMachine.objects.all()
|
||||||
self.fields['termination2_termination'].queryset = VMInterface.objects.all()
|
self.fields['termination2_termination'].queryset = VMInterface.objects.all()
|
||||||
@ -265,7 +265,7 @@ class TunnelTerminationForm(NetBoxModelForm):
|
|||||||
def __init__(self, *args, initial=None, **kwargs):
|
def __init__(self, *args, initial=None, **kwargs):
|
||||||
super().__init__(*args, initial=initial, **kwargs)
|
super().__init__(*args, initial=initial, **kwargs)
|
||||||
|
|
||||||
if initial and initial.get('type') == TunnelTerminationTypeChoices.TYPE_VIRUTALMACHINE:
|
if initial and initial.get('type') == TunnelTerminationTypeChoices.TYPE_VIRTUALMACHINE:
|
||||||
self.fields['parent'].label = _('Virtual Machine')
|
self.fields['parent'].label = _('Virtual Machine')
|
||||||
self.fields['parent'].queryset = VirtualMachine.objects.all()
|
self.fields['parent'].queryset = VirtualMachine.objects.all()
|
||||||
self.fields['termination'].queryset = VMInterface.objects.all()
|
self.fields['termination'].queryset = VMInterface.objects.all()
|
||||||
|
Loading…
Reference in New Issue
Block a user