diff --git a/netbox_acls/models/access_list_rules.py b/netbox_acls/models/access_list_rules.py index c8a46c7..db344e1 100644 --- a/netbox_acls/models/access_list_rules.py +++ b/netbox_acls/models/access_list_rules.py @@ -5,7 +5,6 @@ from django.contrib.postgres.fields import ArrayField from django.core.exceptions import ValidationError from django.db import models -from django.urls import reverse from django.utils.translation import gettext_lazy as _ from netbox.models import NetBoxModel @@ -97,16 +96,6 @@ class Meta: def __str__(self): return f"{self.access_list}: Rule {self.index}" - def get_absolute_url(self): - """ - The method is a Django convention; although not strictly required, - it conveniently returns the absolute URL for any particular object. - """ - return reverse( - f"plugins:{self._meta.app_label}:{self._meta.model_name}", - args=[self.pk], - ) - def get_action_color(self): return ACLRuleActionChoices.colors.get(self.action) diff --git a/netbox_acls/models/access_lists.py b/netbox_acls/models/access_lists.py index 5035a8d..94d95b2 100644 --- a/netbox_acls/models/access_lists.py +++ b/netbox_acls/models/access_lists.py @@ -8,7 +8,6 @@ from django.core.exceptions import ValidationError from django.core.validators import RegexValidator from django.db import models -from django.urls import reverse from django.utils.translation import gettext_lazy as _ from netbox.models import NetBoxModel from virtualization.models import VirtualMachine, VMInterface @@ -78,13 +77,6 @@ class Meta: def __str__(self): return self.name - def get_absolute_url(self): - """ - The method is a Django convention; although not strictly required, - it conveniently returns the absolute URL for any particular object. - """ - return reverse("plugins:netbox_acls:accesslist", args=[self.pk]) - def get_default_action_color(self): return ACLActionChoices.colors.get(self.default_action) @@ -146,16 +138,6 @@ class Meta: def __str__(self): return f"{self.access_list}: Interface {self.assigned_object}" - def get_absolute_url(self): - """ - The method is a Django convention; although not strictly required, - it conveniently returns the absolute URL for any particular object. - """ - return reverse( - "plugins:netbox_acls:aclinterfaceassignment", - args=[self.pk], - ) - def save(self, *args, **kwargs): """Saves the current instance to the database.""" # Ensure the assigned interface's host matches the host assigned to the access list.