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

Fixes #5453: Correct change log representation when creating a cable

This commit is contained in:
Jeremy Stretch
2020-12-15 13:37:02 -05:00
parent 14a46f82ee
commit 67f9e16905
2 changed files with 6 additions and 2 deletions

View File

@@ -147,7 +147,8 @@ class Cable(ChangeLoggedModel, CustomFieldModel):
return instance
def __str__(self):
return self.label or '#{}'.format(self._pk)
pk = self.pk or self._pk
return self.label or f'#{pk}'
def get_absolute_url(self):
return reverse('dcim:cable', args=[self.pk])