mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-17 20:46:30 -06:00
Fix terminations assignment
This commit is contained in:
parent
83fdab5feb
commit
ecee7421ea
@ -92,8 +92,6 @@ class Cable(NetBoxModel):
|
|||||||
null=True
|
null=True
|
||||||
)
|
)
|
||||||
|
|
||||||
terminations = []
|
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
ordering = ('pk',)
|
ordering = ('pk',)
|
||||||
|
|
||||||
@ -112,7 +110,9 @@ class Cable(NetBoxModel):
|
|||||||
assert self.pk is None
|
assert self.pk is None
|
||||||
for t in terminations:
|
for t in terminations:
|
||||||
t.cable = self
|
t.cable = self
|
||||||
self.terminations.append(t)
|
self.terminations = terminations
|
||||||
|
else:
|
||||||
|
self.terminations = []
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_db(cls, db, field_names, values):
|
def from_db(cls, db, field_names, values):
|
||||||
|
Loading…
Reference in New Issue
Block a user