Fixes #2231: Remove get_absolute_url() from DeviceRole

This commit is contained in:
Jeremy Stretch 2018-07-18 11:24:36 -04:00
parent 02b6ffd59a
commit 00d218118c
3 changed files with 1 additions and 5 deletions

View File

@ -781,9 +781,6 @@ class DeviceRole(models.Model):
def __str__(self):
return self.name
def get_absolute_url(self):
return "{}?role={}".format(reverse('dcim:device_list'), self.slug)
def to_csv(self):
return (
self.name,

View File

@ -408,7 +408,6 @@ class DeviceBayTemplateTable(BaseTable):
class DeviceRoleTable(BaseTable):
pk = ToggleColumn()
name = tables.LinkColumn(verbose_name='Name')
device_count = tables.TemplateColumn(
template_code=DEVICEROLE_DEVICE_COUNT,
accessor=Accessor('devices.count'),

View File

@ -146,7 +146,7 @@
<tr>
<td>Role</td>
<td>
<a href="{{ device.device_role.get_absolute_url }}">{{ device.device_role }}</a>
<a href="{% url 'dcim:device_list' %}?role={{ device.device_role.slug }}">{{ device.device_role }}</a>
</td>
</tr>
<tr>