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

Updating page title to include asdot notation

This commit is contained in:
Jason Yates
2022-01-12 16:44:22 +00:00
parent ea644868a6
commit 85f588e8c9

View File

@ -125,7 +125,10 @@ class ASN(PrimaryModel):
verbose_name_plural = 'ASNs'
def __str__(self):
return f'AS{self.asn}'
if self.asn > 65535:
return 'AS{} ({}.{})'.format(self.asn, self.asn // 65536, self.asn % 65536)
else:
return f'AS{self.asn}'
def get_absolute_url(self):
return reverse('ipam:asn', args=[self.pk])