1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Interface.mode to slug (#3569)

This commit is contained in:
Jeremy Stretch
2019-11-21 22:39:15 -05:00
parent f93cd17fee
commit 3fa4ceadb0
10 changed files with 76 additions and 46 deletions

View File

@@ -2261,10 +2261,10 @@ class Interface(CableTermination, ComponentModel):
verbose_name='OOB Management',
help_text='This interface is used only for out-of-band management'
)
mode = models.PositiveSmallIntegerField(
choices=IFACE_MODE_CHOICES,
mode = models.CharField(
max_length=50,
choices=InterfaceModeChoices,
blank=True,
null=True
)
untagged_vlan = models.ForeignKey(
to='ipam.VLAN',
@@ -2373,7 +2373,7 @@ class Interface(CableTermination, ComponentModel):
self.untagged_vlan = None
# Only "tagged" interfaces may have tagged VLANs assigned. ("tagged all" implies all VLANs are assigned.)
if self.pk and self.mode is not IFACE_MODE_TAGGED:
if self.pk and self.mode is not InterfaceModeChoices.MODE_TAGGED:
self.tagged_vlans.clear()
return super().save(*args, **kwargs)