mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-16 04:28:17 -06:00
Update fhrp.py
add Descriotion to the fhrp Group Name
This commit is contained in:
parent
69eb6b11d0
commit
64dea8a780
@ -59,13 +59,18 @@ class FHRPGroup(PrimaryModel):
|
||||
name = f'{self.get_protocol_display()}: {self.group_id}'
|
||||
|
||||
# Append the first assigned IP addresses (if any) to serve as an additional identifier
|
||||
# If present add the Description
|
||||
if self.pk:
|
||||
ip_address = self.ip_addresses.first()
|
||||
if ip_address:
|
||||
if self.description:
|
||||
return f"{name} ({self.description}) ({ip_address})"
|
||||
return f"{name} ({ip_address})"
|
||||
|
||||
if self.description:
|
||||
return f"{name} ({self.description})"
|
||||
return name
|
||||
|
||||
|
||||
def get_absolute_url(self):
|
||||
return reverse('ipam:fhrpgroup', args=[self.pk])
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user