Skip to content

Commit

Permalink
Check if DEFAULT_USER_PREFERENCES are configured
Browse files Browse the repository at this point in the history
  • Loading branch information
renatoalmeidaoliveira committed Jan 30, 2025
1 parent 22af6dd commit 62148bb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion netbox/netbox/tables/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def __init__(self, *args, user=None, **kwargs):
selected_columns = None
if user is not None and not isinstance(user, AnonymousUser):
selected_columns = user.config.get(f"tables.{self.name}.columns")
elif isinstance(user, AnonymousUser):
elif isinstance(user, AnonymousUser) and hasattr(settings, 'DEFAULT_USER_PREFERENCES'):
default_user_preferences = settings.DEFAULT_USER_PREFERENCES
default_table = default_user_preferences.get('tables', {}).get(self.name, {}).get('columns', {})
if default_table != {}:
Expand Down

0 comments on commit 62148bb

Please sign in to comment.