From 8652b27ac282eb186c4a52d5b66fbdb776ab6d5c Mon Sep 17 00:00:00 2001 From: Jan Krupa Date: Fri, 6 Mar 2026 12:19:05 +0000 Subject: [PATCH 1/3] 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. --- netbox_custom_objects_tab/__init__.py | 4 +++- netbox_custom_objects_tab/views/typed.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/netbox_custom_objects_tab/__init__.py b/netbox_custom_objects_tab/__init__.py index 253a10e..dfce8b0 100644 --- a/netbox_custom_objects_tab/__init__.py +++ b/netbox_custom_objects_tab/__init__.py @@ -1,3 +1,5 @@ +from importlib.metadata import version + from netbox.plugins import PluginConfig @@ -5,7 +7,7 @@ class NetBoxCustomObjectsTabConfig(PluginConfig): name = "netbox_custom_objects_tab" verbose_name = "Custom Objects Tab" description = 'Adds a "Custom Objects" tab to NetBox object detail pages' - version = "2.0.1" + version = version("netbox-custom-objects-tab") author = "Jan Krupa" author_email = "jan.krupa@cesnet.cz" base_url = "custom-objects-tab" diff --git a/netbox_custom_objects_tab/views/typed.py b/netbox_custom_objects_tab/views/typed.py index 395e8d7..0419758 100644 --- a/netbox_custom_objects_tab/views/typed.py +++ b/netbox_custom_objects_tab/views/typed.py @@ -203,7 +203,7 @@ def get(self, request, pk): # Build table class and instantiate table_class = _build_typed_table_class(cot, dynamic_model) - table = table_class(filtered_qs, user=request.user) + table = table_class(filtered_qs) table.columns.show("pk") # Shadow @cached_property to avoid reverse error for dynamic models From c2632dea35a3f39478a8a9c5281f9c0ec1f1cb5e Mon Sep 17 00:00:00 2001 From: Jan Krupa Date: Fri, 6 Mar 2026 12:19:37 +0000 Subject: [PATCH 2/3] Bump version to 2.0.2 and ignore .claude/ directory --- .gitignore | 4 ++-- pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 02d6c4e..e2269c8 100644 --- a/.gitignore +++ b/.gitignore @@ -29,5 +29,5 @@ db.sqlite3 *.swo tools/ - -ignore/ \ No newline at end of file +ignore/ +.claude/ \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 991509c..2cddc83 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "netbox-custom-objects-tab" -version = "2.0.1" +version = "2.0.2" description = "NetBox plugin that adds a Custom Objects tab to object detail pages" readme = "README.md" requires-python = ">=3.12" From 4ce4da1103d8f8d0c5f83f628b3a27b3276cbde2 Mon Sep 17 00:00:00 2001 From: Jan Krupa Date: Fri, 6 Mar 2026 12:21:00 +0000 Subject: [PATCH 3/3] Add 2.0.2 changelog entry --- CHANGELOG.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a19d425..a958664 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.0.2] - 2026-03-06 + +### Fixed + +- **TypeError on typed tab** — removed `user=` keyword argument from `CustomObjectTable` + instantiation. `django_tables2.Table.__init__` does not accept this kwarg; it was + redundant because `table.configure(request)` already applies per-user column preferences. + Fixes crash on NetBox 4.5.4-Docker (`netbox_custom_objects` 0.4.6). + +### Changed + +- Plugin version is now defined only in `pyproject.toml` and read at runtime via + `importlib.metadata.version()`, eliminating the duplicate version string in `__init__.py`. + ## [2.0.1] - 2026-02-25 ### Added