mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-23 04:22:01 -06:00
Fixes #1847: Fix RecursionError when VC master device is unnamed
This commit is contained in:
parent
5037283b62
commit
215156c333
@ -1044,7 +1044,7 @@ class Device(CreatedUpdatedModel, CustomFieldModel):
|
||||
def display_name(self):
|
||||
if self.name:
|
||||
return self.name
|
||||
elif hasattr(self, 'vc_membership'):
|
||||
elif hasattr(self, 'vc_membership') and self.vc_membership.virtual_chassis.master.name:
|
||||
return "{}:{}".format(self.vc_membership.virtual_chassis.master, self.vc_membership.position)
|
||||
elif hasattr(self, 'device_type'):
|
||||
return "{}".format(self.device_type)
|
||||
|
Loading…
Reference in New Issue
Block a user