mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-23 04:22:01 -06:00
Always include the 'actions' column, if present
This commit is contained in:
parent
ed21ff52ee
commit
88687608e7
@ -28,6 +28,7 @@ class BaseTable(tables.Table):
|
||||
# Apply custom column ordering
|
||||
if columns is not None:
|
||||
pk = self.base_columns.pop('pk', None)
|
||||
actions = self.base_columns.pop('actions', None)
|
||||
|
||||
for name, column in self.base_columns.items():
|
||||
if name in columns:
|
||||
@ -36,10 +37,13 @@ class BaseTable(tables.Table):
|
||||
self.columns.hide(name)
|
||||
self.sequence = columns
|
||||
|
||||
# Always include PK column, if defined on the table
|
||||
# Always include PK and actions column, if defined on the table
|
||||
if pk:
|
||||
self.base_columns['pk'] = pk
|
||||
self.sequence.insert(0, 'pk')
|
||||
if actions:
|
||||
self.base_columns['actions'] = actions
|
||||
self.sequence.append('actions')
|
||||
|
||||
@property
|
||||
def configurable_columns(self):
|
||||
|
Loading…
Reference in New Issue
Block a user