Skip to content

Commit 8652b27

Browse files
committed
Fix Table user kwarg crash and single-source version
- Remove user=request.user from typed tab table instantiation; django_tables2.Table does not accept this kwarg and NetBox 4.5.4 passes it through, causing TypeError. Per-user preferences are already applied by table.configure(request) called immediately after. - Read plugin version from package metadata (importlib.metadata) so it is defined only in pyproject.toml, not duplicated in __init__.py.
1 parent fd7835e commit 8652b27

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

netbox_custom_objects_tab/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
from importlib.metadata import version
2+
13
from netbox.plugins import PluginConfig
24

35

46
class NetBoxCustomObjectsTabConfig(PluginConfig):
57
name = "netbox_custom_objects_tab"
68
verbose_name = "Custom Objects Tab"
79
description = 'Adds a "Custom Objects" tab to NetBox object detail pages'
8-
version = "2.0.1"
10+
version = version("netbox-custom-objects-tab")
911
author = "Jan Krupa"
1012
author_email = "jan.krupa@cesnet.cz"
1113
base_url = "custom-objects-tab"

netbox_custom_objects_tab/views/typed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ def get(self, request, pk):
203203

204204
# Build table class and instantiate
205205
table_class = _build_typed_table_class(cot, dynamic_model)
206-
table = table_class(filtered_qs, user=request.user)
206+
table = table_class(filtered_qs)
207207
table.columns.show("pk")
208208

209209
# Shadow @cached_property to avoid reverse error for dynamic models

0 commit comments

Comments
 (0)