From 00ab899604456b082e49520703ade6ccc7471829 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Mon, 7 Apr 2025 16:49:57 -0400 Subject: [PATCH] Misc cleanup --- netbox/netbox/tables/tables.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/netbox/netbox/tables/tables.py b/netbox/netbox/tables/tables.py index cbcccdf92..040a3a60e 100644 --- a/netbox/netbox/tables/tables.py +++ b/netbox/netbox/tables/tables.py @@ -117,9 +117,6 @@ class BaseTable(tables.Table): """ Update the table sequence to display only the named columns and any exempt columns. """ - if not selected_columns: - raise Exception('wtf?') - # Hide non-selected columns which are not exempt for column in self.columns: if column.name not in [*selected_columns, *self.exempt_columns]: @@ -187,10 +184,12 @@ class BaseTable(tables.Table): @property def configuration(self): - return { + config = { 'columns': ','.join([c[0] for c in self.selected_columns]), - 'ordering': self.order_by, } + if self.order_by: + config['ordering'] = self.order_by + return config @property def config_params(self):