Explorar el Código

Fixes: #3534 - Add none option for untagged vlan field

Daniel Sheppard hace 6 años
padre
commit
8996c530c9
Se han modificado 1 ficheros con 3 adiciones y 3 borrados
  1. 3 3
      netbox/dcim/forms.py

+ 3 - 3
netbox/dcim/forms.py

@@ -2220,7 +2220,7 @@ class InterfaceForm(InterfaceCommonForm, BootstrapMixin, forms.ModelForm):
                     [(vlan.pk, vlan) for vlan in site_group_vlans]
                 ))
 
-        self.fields['untagged_vlan'].choices = vlan_choices
+        self.fields['untagged_vlan'].choices = [(None, '---------')] + vlan_choices
         self.fields['tagged_vlans'].choices = vlan_choices
 
 
@@ -2330,7 +2330,7 @@ class InterfaceCreateForm(InterfaceCommonForm, ComponentForm, forms.Form):
                     [(vlan.pk, vlan) for vlan in site_group_vlans]
                 ))
 
-        self.fields['untagged_vlan'].choices = vlan_choices
+        self.fields['untagged_vlan'].choices = [(None, '---------')] + vlan_choices
         self.fields['tagged_vlans'].choices = vlan_choices
 
 
@@ -2442,7 +2442,7 @@ class InterfaceBulkEditForm(InterfaceCommonForm, BootstrapMixin, AddRemoveTagsFo
                         [(vlan.pk, vlan) for vlan in site_group_vlans]
                     ))
 
-        self.fields['untagged_vlan'].choices = vlan_choices
+        self.fields['untagged_vlan'].choices = [(None, '---------')] + vlan_choices
         self.fields['tagged_vlans'].choices = vlan_choices