mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-28 03:16:25 -06:00
Reflect virtual chassis membership in display_name
This commit is contained in:
parent
9119823ef9
commit
0b056b4f89
@ -1037,6 +1037,8 @@ class Device(CreatedUpdatedModel, CustomFieldModel):
|
||||
def display_name(self):
|
||||
if self.name:
|
||||
return self.name
|
||||
elif hasattr(self, 'vc_membership'):
|
||||
return "{}:{}".format(self.vc_membership.virtual_chassis.master, self.vc_membership.position)
|
||||
elif hasattr(self, 'device_type'):
|
||||
return "{}".format(self.device_type)
|
||||
return ""
|
||||
|
Loading…
Reference in New Issue
Block a user