mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-30 04:16:24 -06:00
Define vlan_translation_table conditionally
This commit is contained in:
parent
722c7ba6af
commit
04fb92fa98
@ -2579,10 +2579,12 @@ class InterfaceView(generic.ObjectView):
|
||||
data=vlans,
|
||||
orderable=False
|
||||
)
|
||||
vlan_translation_table = VLANTranslationRuleTable(
|
||||
data=instance.vlan_translation_policy.rules.all() if instance.vlan_translation_policy else [],
|
||||
orderable=False
|
||||
)
|
||||
vlan_translation_table = None
|
||||
if instance.vlan_translation_policy:
|
||||
vlan_translation_table = VLANTranslationRuleTable(
|
||||
data=instance.vlan_translation_policy.rules.all(),
|
||||
orderable=False
|
||||
)
|
||||
|
||||
return {
|
||||
'vdc_table': vdc_table,
|
||||
|
@ -515,10 +515,12 @@ class VMInterfaceView(generic.ObjectView):
|
||||
exclude=('virtual_machine',),
|
||||
orderable=False
|
||||
)
|
||||
vlan_translation_table = VLANTranslationRuleTable(
|
||||
data=instance.vlan_translation_policy.rules.all() if instance.vlan_translation_policy else [],
|
||||
orderable=False
|
||||
)
|
||||
vlan_translation_table = None
|
||||
if instance.vlan_translation_policy:
|
||||
vlan_translation_table = VLANTranslationRuleTable(
|
||||
data=instance.vlan_translation_policy.rules.all(),
|
||||
orderable=False
|
||||
)
|
||||
|
||||
# Get assigned VLANs and annotate whether each is tagged or untagged
|
||||
vlans = []
|
||||
|
Loading…
Reference in New Issue
Block a user