Skip to content
Merged
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
5 changes: 3 additions & 2 deletions netbox/circuits/tables/circuits.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ class CircuitTerminationTable(NetBoxTable):
)
termination = tables.Column(
verbose_name=_('Termination Point'),
linkify=True
linkify=True,
orderable=False,
)

# Termination types
Expand All @@ -132,7 +133,7 @@ class CircuitTerminationTable(NetBoxTable):
site_group = tables.Column(
verbose_name=_('Site Group'),
linkify=True,
accessor='_sitegroup'
accessor='_site_group'
)
region = tables.Column(
verbose_name=_('Region'),
Expand Down
23 changes: 23 additions & 0 deletions netbox/circuits/tests/test_tables.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from django.test import RequestFactory, tag, TestCase

from circuits.models import CircuitTermination
from circuits.tables import CircuitTerminationTable


@tag('regression')
class CircuitTerminationTableTest(TestCase):
def test_every_orderable_field_does_not_throw_exception(self):
terminations = CircuitTermination.objects.all()
disallowed = {'actions', }

orderable_columns = [
column.name for column in CircuitTerminationTable(terminations).columns
if column.orderable and column.name not in disallowed
]
fake_request = RequestFactory().get("/")

for col in orderable_columns:
for dir in ('-', ''):
table = CircuitTerminationTable(terminations)
table.order_by = f'{dir}{col}'
table.as_html(fake_request)
3 changes: 2 additions & 1 deletion netbox/vpn/tables/tunnels.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ class TunnelTerminationTable(TenancyColumnsMixin, NetBoxTable):
)
termination = tables.Column(
verbose_name=_('Tunnel interface'),
linkify=True
linkify=True,
orderable=False,
)
ip_addresses = columns.ManyToManyColumn(
accessor=tables.A('termination__ip_addresses'),
Expand Down