Fixes #16376: Log changes on terminating objects when attaching a cable

This commit is contained in:
Jeremy Stretch 2024-06-04 13:51:40 -04:00
parent 87109f5539
commit 4242546270

View File

@ -355,11 +355,11 @@ class CableTermination(ChangeLoggedModel):
super().save(*args, **kwargs) super().save(*args, **kwargs)
# Set the cable on the terminating object # Set the cable on the terminating object
termination_model = self.termination._meta.model termination = self.termination._meta.model.objects.get(pk=self.termination_id)
termination_model.objects.filter(pk=self.termination_id).update( termination.snapshot()
cable=self.cable, termination.cable = self.cable
cable_end=self.cable_end termination.cable_end = self.cable_end
) termination.save()
def delete(self, *args, **kwargs): def delete(self, *args, **kwargs):