1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Fixes #3898: Call str of cable on delete to save PK in id_string

This commit is contained in:
Saria Hajjar
2020-01-12 11:08:13 +00:00
parent b7e78028ce
commit a2308b9c99
2 changed files with 6 additions and 0 deletions

View File

@ -28,6 +28,7 @@
* [#3872](https://github.com/netbox-community/netbox/issues/3872) - Paginate related IPs of an address * [#3872](https://github.com/netbox-community/netbox/issues/3872) - Paginate related IPs of an address
* [#3876](https://github.com/netbox-community/netbox/issues/3876) - Fixed min/max to ASN input field at the site creation page * [#3876](https://github.com/netbox-community/netbox/issues/3876) - Fixed min/max to ASN input field at the site creation page
* [#3882](https://github.com/netbox-community/netbox/issues/3882) - Fix filtering of devices by rack group * [#3882](https://github.com/netbox-community/netbox/issues/3882) - Fix filtering of devices by rack group
* [#3898](https://github.com/netbox-community/netbox/issues/3898) - Fix deleted message being set to None for cable
--- ---

View File

@ -3040,6 +3040,11 @@ class Cable(ChangeLoggedModel):
def get_absolute_url(self): def get_absolute_url(self):
return reverse('dcim:cable', args=[self.pk]) return reverse('dcim:cable', args=[self.pk])
def delete(self, *args, **kwargs):
# Trigger the __str__ method to save the pk into `self.id_string`
str(self)
super().delete(*args, **kwargs)
def clean(self): def clean(self):
# Validate that termination A exists # Validate that termination A exists