mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-16 12:12:53 -06:00
Fixes #19296: Fix logic for determining default selected columns
This commit is contained in:
parent
d005c470c9
commit
8bd8f28cb9
@ -165,11 +165,10 @@ class BaseTable(tables.Table):
|
|||||||
ordering = userconfig.get(f"tables.{self.name}.ordering")
|
ordering = userconfig.get(f"tables.{self.name}.ordering")
|
||||||
|
|
||||||
# Fall back to the default columns & ordering
|
# Fall back to the default columns & ordering
|
||||||
|
if columns is None and hasattr(settings, 'DEFAULT_USER_PREFERENCES'):
|
||||||
|
columns = settings.DEFAULT_USER_PREFERENCES.get('tables', {}).get(self.name, {}).get('columns')
|
||||||
if columns is None:
|
if columns is None:
|
||||||
if hasattr(settings, 'DEFAULT_USER_PREFERENCES'):
|
columns = getattr(self.Meta, 'default_columns', self.Meta.fields)
|
||||||
columns = settings.DEFAULT_USER_PREFERENCES.get('tables', {}).get(self.name, {}).get('columns')
|
|
||||||
else:
|
|
||||||
columns = getattr(self.Meta, 'default_columns', self.Meta.fields)
|
|
||||||
|
|
||||||
self._set_columns(columns)
|
self._set_columns(columns)
|
||||||
if ordering is not None:
|
if ordering is not None:
|
||||||
|
Loading…
Reference in New Issue
Block a user