Prevent cleanup of tagged_vlans when no tagged_vlans set on interface

This commit is contained in:
Daniel Sheppard 2024-08-19 20:33:42 -05:00
parent 5c9a145255
commit 282836c9a0

View File

@ -913,7 +913,7 @@ class Interface(ModularComponentModel, BaseInterface, CabledObjectModel, PathEnd
self.rf_channel_width = get_channel_attr(self.rf_channel, 'width')
# Clear any tagged vlans set when mode is tagged-all
if self.mode == InterfaceModeChoices.MODE_TAGGED_ALL and self.tagged_vlans:
if self.mode == InterfaceModeChoices.MODE_TAGGED_ALL and self.tagged_vlans.count():
self.tagged_vlans.set([])
super().save(*args, **kwargs)