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:
@@ -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()
|
||||
|
Reference in New Issue
Block a user