diff --git a/netbox/netbox/tables/tables.py b/netbox/netbox/tables/tables.py index 040a3a60e..37540a92b 100644 --- a/netbox/netbox/tables/tables.py +++ b/netbox/netbox/tables/tables.py @@ -193,8 +193,10 @@ class BaseTable(tables.Table): @property def config_params(self): + if not (model := getattr(self.Meta, 'model', None)): + return None return urlencode({ - 'object_type': ObjectType.objects.get_for_model(self.Meta.model).pk, + 'object_type': ObjectType.objects.get_for_model(model).pk, 'table': self.name, **self.configuration, }) diff --git a/netbox/templates/htmx/table.html b/netbox/templates/htmx/table.html index 376764cef..49788ffa9 100644 --- a/netbox/templates/htmx/table.html +++ b/netbox/templates/htmx/table.html @@ -20,7 +20,9 @@
{{ table.rows|length }}
{# Include the updated "save" link for the table configuration #} - Save + {% if table.config_params %} + Save + {% endif %} {# Update the bulk action buttons with new query parameters #} {% if actions %} diff --git a/netbox/templates/inc/table_controls_htmx.html b/netbox/templates/inc/table_controls_htmx.html index 29a2c47c6..0bcd25e76 100644 --- a/netbox/templates/inc/table_controls_htmx.html +++ b/netbox/templates/inc/table_controls_htmx.html @@ -34,7 +34,9 @@ Toggle Dropdown