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/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 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 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"