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

Enable bulk creation tests for device components

This commit is contained in:
Jeremy Stretch
2020-02-05 15:22:57 -05:00
parent 75906f7591
commit 0ad613e6b4
5 changed files with 194 additions and 8 deletions

View File

@@ -2952,9 +2952,10 @@ class FrontPortCreateForm(ComponentForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
parent = Device.objects.get(pk=self.initial['device'])
parent = Device.objects.get(pk=self.initial.get('device'))
# Determine which rear port positions are occupied. These will be excluded from the list of available mappings.
# Determine which rear port positions are occupied. These will be excluded from the list of available
# mappings.
occupied_port_positions = [
(front_port.rear_port_id, front_port.rear_port_position)
for front_port in parent.frontports.all()