mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Moved cable caching logic from Cable.save() to signals
This commit is contained in:
@@ -68,6 +68,7 @@ class CableTermination(models.Model):
|
||||
cable = models.ForeignKey(
|
||||
to='dcim.Cable',
|
||||
on_delete=models.SET_NULL,
|
||||
related_name='+',
|
||||
blank=True,
|
||||
null=True
|
||||
)
|
||||
@@ -2426,12 +2427,6 @@ class Cable(ChangeLoggedModel):
|
||||
|
||||
super(Cable, self).save(*args, **kwargs)
|
||||
|
||||
# Cache the Cable on its two termination points
|
||||
self.termination_a.cable = self
|
||||
self.termination_a.save()
|
||||
self.termination_b.cable = self
|
||||
self.termination_b.save()
|
||||
|
||||
def get_path_endpoints(self):
|
||||
"""
|
||||
Traverse both ends of a cable path and return its connected endpoints. Note that one or both endpoints may be
|
||||
|
Reference in New Issue
Block a user