mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-22 21:32:23 -06:00
16546 define get_absolute_url method in NetBoxModel (#17693)
* 16546 define get_absolute_url method in NetBoxModel * 16546 define get_absolute_url method in NetBoxModel * 16546 define get_absolute_url method in NetBoxModel * 16546 move get_absolute_url to NetBoxFeatureSet * 16546 fix CircuitTermination * Fix linebreaks --------- Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
This commit is contained in:
@@ -68,9 +68,6 @@ class L2VPN(ContactsMixin, PrimaryModel):
|
||||
return f'{self.name} ({self.identifier})'
|
||||
return f'{self.name}'
|
||||
|
||||
def get_absolute_url(self):
|
||||
return reverse('vpn:l2vpn', args=[self.pk])
|
||||
|
||||
@cached_property
|
||||
def can_add_termination(self):
|
||||
if self.type in L2VPNTypeChoices.P2P and self.terminations.count() >= 2:
|
||||
@@ -121,9 +118,6 @@ class L2VPNTermination(NetBoxModel):
|
||||
return f'{self.assigned_object} <> {self.l2vpn}'
|
||||
return super().__str__()
|
||||
|
||||
def get_absolute_url(self):
|
||||
return reverse('vpn:l2vpntermination', args=[self.pk])
|
||||
|
||||
def clean(self):
|
||||
# Only check is assigned_object is set. Required otherwise we have an Integrity Error thrown.
|
||||
if self.assigned_object:
|
||||
|
||||
Reference in New Issue
Block a user