Second attempt at a patch for #3193

This commit is contained in:
Sander Steffann 2019-06-17 21:09:08 +02:00
parent 90f7122fde
commit 1661af480f
2 changed files with 22 additions and 3 deletions

View File

@ -0,0 +1,19 @@
# Generated by Django 2.2.2 on 2019-06-17 19:07
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('dcim', '0069_deprecate_nullablecharfield'),
]
operations = [
migrations.AlterField(
model_name='interface',
name='_connected_circuittermination',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='circuits.CircuitTermination'),
),
]

View File

@ -1946,7 +1946,7 @@ class Interface(CableTermination, ComponentModel):
blank=True, blank=True,
null=True null=True
) )
_connected_circuittermination = models.OneToOneField( _connected_circuittermination = models.ForeignKey(
to='circuits.CircuitTermination', to='circuits.CircuitTermination',
on_delete=models.SET_NULL, on_delete=models.SET_NULL,
related_name='+', related_name='+',
@ -2673,8 +2673,8 @@ class Cable(ChangeLoggedModel):
Traverse both ends of a cable path and return its connected endpoints. Note that one or both endpoints may be Traverse both ends of a cable path and return its connected endpoints. Note that one or both endpoints may be
None. None.
""" """
a_path = self.termination_b.trace() a_path = self.termination_b.trace(follow_circuits=True)
b_path = self.termination_a.trace() b_path = self.termination_a.trace(follow_circuits=True)
# Determine overall path status (connected or planned) # Determine overall path status (connected or planned)
if self.status == CONNECTION_STATUS_PLANNED: if self.status == CONNECTION_STATUS_PLANNED: