Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions netbox_acls/models/access_list_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)

Expand Down
18 changes: 0 additions & 18 deletions netbox_acls/models/access_lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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.
Expand Down