Fix terminations assignment

This commit is contained in:
jeremystretch 2022-05-05 15:19:10 -04:00
parent 83fdab5feb
commit ecee7421ea

View File

@ -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):