Skip to content

Commit

Permalink
Fix test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
DanSheps committed Oct 17, 2024
1 parent 8dd6119 commit 365e2fb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion netbox/dcim/forms/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ def clean(self):

parent_field = 'device' if 'device' in self.cleaned_data else 'virtual_machine'
interface_mode = get_field_value(self, parent_field)
tagged_vlans = get_field_value(self, 'tagged_vlans') if 'tagged_vlans' in self.fields.keys() else []
if 'tagged_vlans' in self.fields.keys():
tagged_vlans = self.cleaned_data.get('tagged_vlans') if self.is_bound else \
self.get_initial_for_field(self.fields['tagged_vlans'], 'tagged_vlans')
else:
tagged_vlans = []

# Untagged interfaces cannot be assigned tagged VLANs
if self.cleaned_data['mode'] == InterfaceModeChoices.MODE_ACCESS and tagged_vlans:
Expand Down

0 comments on commit 365e2fb

Please sign in to comment.