From 5fec4ec25594bd5dad4f6bffb89e7fa19d80fcd7 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Mon, 5 Apr 2021 11:47:25 -0400 Subject: [PATCH] LinkedCountColumn should always invoke filter by ID --- netbox/dcim/tables/devices.py | 8 ++++---- netbox/ipam/tables.py | 8 ++++---- netbox/secrets/tables.py | 2 +- netbox/tenancy/tables.py | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/netbox/dcim/tables/devices.py b/netbox/dcim/tables/devices.py index 7b6fb997d..cc1d78fa3 100644 --- a/netbox/dcim/tables/devices.py +++ b/netbox/dcim/tables/devices.py @@ -63,12 +63,12 @@ class DeviceRoleTable(BaseTable): ) device_count = LinkedCountColumn( viewname='dcim:device_list', - url_params={'role': 'slug'}, + url_params={'role_id': 'pk'}, verbose_name='Devices' ) vm_count = LinkedCountColumn( viewname='virtualization:virtualmachine_list', - url_params={'role': 'slug'}, + url_params={'role_id': 'pk'}, verbose_name='VMs' ) color = ColorColumn() @@ -92,12 +92,12 @@ class PlatformTable(BaseTable): ) device_count = LinkedCountColumn( viewname='dcim:device_list', - url_params={'platform': 'slug'}, + url_params={'platform_id': 'pk'}, verbose_name='Devices' ) vm_count = LinkedCountColumn( viewname='virtualization:virtualmachine_list', - url_params={'platform': 'slug'}, + url_params={'platform_id': 'pk'}, verbose_name='VMs' ) actions = ButtonsColumn(Platform) diff --git a/netbox/ipam/tables.py b/netbox/ipam/tables.py index 374161011..6fe8365f5 100644 --- a/netbox/ipam/tables.py +++ b/netbox/ipam/tables.py @@ -176,7 +176,7 @@ class RIRTable(BaseTable): ) aggregate_count = LinkedCountColumn( viewname='ipam:aggregate_list', - url_params={'rir': 'slug'}, + url_params={'rir_id': 'pk'}, verbose_name='Aggregates' ) actions = ButtonsColumn(RIR) @@ -236,12 +236,12 @@ class RoleTable(BaseTable): ) prefix_count = LinkedCountColumn( viewname='ipam:prefix_list', - url_params={'role': 'slug'}, + url_params={'role_id': 'pk'}, verbose_name='Prefixes' ) vlan_count = LinkedCountColumn( viewname='ipam:vlan_list', - url_params={'role': 'slug'}, + url_params={'role_id': 'pk'}, verbose_name='VLANs' ) actions = ButtonsColumn(Role) @@ -434,7 +434,7 @@ class VLANGroupTable(BaseTable): ) vlan_count = LinkedCountColumn( viewname='ipam:vlan_list', - url_params={'group': 'slug'}, + url_params={'group_id': 'pk'}, verbose_name='VLANs' ) actions = ButtonsColumn( diff --git a/netbox/secrets/tables.py b/netbox/secrets/tables.py index b2f8fcc8c..7e164920a 100644 --- a/netbox/secrets/tables.py +++ b/netbox/secrets/tables.py @@ -15,7 +15,7 @@ class SecretRoleTable(BaseTable): ) secret_count = LinkedCountColumn( viewname='secrets:secret_list', - url_params={'role': 'slug'}, + url_params={'role_id': 'pk'}, verbose_name='Secrets' ) actions = ButtonsColumn(SecretRole) diff --git a/netbox/tenancy/tables.py b/netbox/tenancy/tables.py index 968ba787d..803675bfd 100644 --- a/netbox/tenancy/tables.py +++ b/netbox/tenancy/tables.py @@ -40,7 +40,7 @@ class TenantGroupTable(BaseTable): ) tenant_count = LinkedCountColumn( viewname='tenancy:tenant_list', - url_params={'group': 'slug'}, + url_params={'group_id': 'pk'}, verbose_name='Tenants' ) actions = ButtonsColumn(TenantGroup)