Skip to content

Commit

Permalink
Remove custom get_absolute_url method
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcgill298 committed Sep 7, 2023
1 parent 82fe01e commit 7158511
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions nautobot_golden_config/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from deepdiff import DeepDiff
from django.core.exceptions import ValidationError
from django.db import models
from django.shortcuts import reverse
from django.utils.module_loading import import_string
from nautobot.core.models.generics import PrimaryModel
from nautobot.extras.models import ObjectChange
Expand Down Expand Up @@ -169,11 +168,6 @@ def __str__(self):
"""Return a sane string representation of the instance."""
return self.slug

# TODO: Fix pylint arguments-differ for 2.x migration
def get_absolute_url(self): # pylint: disable=arguments-differ
"""Absolute url for the ComplianceFeature instance."""
return reverse("plugins:nautobot_golden_config:compliancefeature", args=[self.pk])


@extras_features(
"custom_fields",
Expand Down Expand Up @@ -234,11 +228,6 @@ def __str__(self):
"""Return a sane string representation of the instance."""
return f"{self.platform} - {self.feature.name}"

# TODO: Fix pylint arguments-differ for 2.x migration
def get_absolute_url(self): # pylint: disable=arguments-differ
"""Absolute url for the ComplianceRule instance."""
return reverse("plugins:nautobot_golden_config:compliancerule", args=[self.pk])

def clean(self):
"""Verify that if cli, then match_config is set."""
if self.config_type == ComplianceRuleConfigTypeChoice.TYPE_CLI and not self.match_config:
Expand Down Expand Up @@ -268,11 +257,6 @@ class ConfigCompliance(PrimaryModel): # pylint: disable=too-many-ancestors
# Used for django-pivot, both compliance and compliance_int should be set.
compliance_int = models.IntegerField(null=True, blank=True)

# TODO: Fix pylint arguments-differ for 2.x migration
def get_absolute_url(self): # pylint: disable=arguments-differ
"""Return absolute URL for instance."""
return reverse("plugins:nautobot_golden_config:configcompliance", args=[self.pk])

def to_objectchange(
self, action, *, related_object=None, object_data_extra=None, object_data_exclude=None
): # pylint: disable=arguments-differ
Expand Down Expand Up @@ -577,11 +561,6 @@ class Meta:
ordering = ("platform", "name")
unique_together = ("name", "platform")

# TODO: Fix pylint arguments-differ for 2.x migration
def get_absolute_url(self): # pylint: disable=arguments-differ
"""Return absolute URL for instance."""
return reverse("plugins:nautobot_golden_config:configreplace", args=[self.pk])

def __str__(self):
"""Return a simple string if model is called."""
return self.name

0 comments on commit 7158511

Please sign in to comment.