Skip to content

Commit

Permalink
Fixes #14709: Correct typo in TYPE_VIRTUALMACHINE
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremystretch committed Jan 8, 2024
1 parent ea5d33f commit 5223486
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions netbox/vpn/choices.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ class TunnelEncapsulationChoices(ChoiceSet):
class TunnelTerminationTypeChoices(ChoiceSet):
# For TunnelCreateForm
TYPE_DEVICE = 'dcim.device'
TYPE_VIRUTALMACHINE = 'virtualization.virtualmachine'
TYPE_VIRTUALMACHINE = 'virtualization.virtualmachine'

CHOICES = (
(TYPE_DEVICE, _('Device')),
(TYPE_VIRUTALMACHINE, _('Virtual Machine')),
(TYPE_VIRTUALMACHINE, _('Virtual Machine')),
)


Expand Down
6 changes: 3 additions & 3 deletions netbox/vpn/forms/model_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class TunnelCreateForm(TunnelForm):
def __init__(self, *args, initial=None, **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'].queryset = VirtualMachine.objects.all()
self.fields['termination1_termination'].queryset = VMInterface.objects.all()
Expand All @@ -168,7 +168,7 @@ def __init__(self, *args, initial=None, **kwargs):
'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'].queryset = VirtualMachine.objects.all()
self.fields['termination2_termination'].queryset = VMInterface.objects.all()
Expand Down Expand Up @@ -265,7 +265,7 @@ class Meta:
def __init__(self, *args, initial=None, **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'].queryset = VirtualMachine.objects.all()
self.fields['termination'].queryset = VMInterface.objects.all()
Expand Down

0 comments on commit 5223486

Please sign in to comment.