|
@@ -2072,6 +2072,7 @@ class InterfaceConnection(models.Model):
|
|
|
(self.interface_a, self.interface_b),
|
|
(self.interface_a, self.interface_b),
|
|
|
(self.interface_b, self.interface_a),
|
|
(self.interface_b, self.interface_a),
|
|
|
)
|
|
)
|
|
|
|
|
+
|
|
|
for interface, peer_interface in interfaces:
|
|
for interface, peer_interface in interfaces:
|
|
|
if action == OBJECTCHANGE_ACTION_DELETE:
|
|
if action == OBJECTCHANGE_ACTION_DELETE:
|
|
|
connection_data = {
|
|
connection_data = {
|
|
@@ -2082,11 +2083,17 @@ class InterfaceConnection(models.Model):
|
|
|
'connected_interface': peer_interface.pk,
|
|
'connected_interface': peer_interface.pk,
|
|
|
'connection_status': self.connection_status
|
|
'connection_status': self.connection_status
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ try:
|
|
|
|
|
+ parent_obj = interface.parent
|
|
|
|
|
+ except ObjectDoesNotExist:
|
|
|
|
|
+ parent_obj = None
|
|
|
|
|
+
|
|
|
ObjectChange(
|
|
ObjectChange(
|
|
|
user=user,
|
|
user=user,
|
|
|
request_id=request_id,
|
|
request_id=request_id,
|
|
|
changed_object=interface,
|
|
changed_object=interface,
|
|
|
- related_object=interface.parent,
|
|
|
|
|
|
|
+ related_object=parent_obj,
|
|
|
action=OBJECTCHANGE_ACTION_UPDATE,
|
|
action=OBJECTCHANGE_ACTION_UPDATE,
|
|
|
object_data=serialize_object(interface, extra=connection_data)
|
|
object_data=serialize_object(interface, extra=connection_data)
|
|
|
).save()
|
|
).save()
|