From f75d7cfca1a4787b31114866301196f2fca4bdfa Mon Sep 17 00:00:00 2001 From: iamjohnnymac <33052970+iamjohnnymac@users.noreply.github.com> Date: Tue, 19 May 2026 09:42:31 +0800 Subject: [PATCH 1/2] fix: drop duplicate 'Trace this core' inline include on strand detail (v0.3.8) v0.3.7 wired plugin_right_page into strand.html, which made the StrandTraceButton PluginTemplateExtension fire and render the trace button. The template also kept the pre-v0.3.1 inline include of the button as a workaround, so the button rendered twice. Removed the inline include + updated the extension's docstring. --- CHANGELOG.md | 15 ++++++++++++++- netbox_osp/__init__.py | 2 +- netbox_osp/template_content.py | 6 +++--- netbox_osp/templates/netbox_osp/strand.html | 6 ++++-- pyproject.toml | 2 +- 5 files changed, 23 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b6b63ad..832648a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,18 @@ Per-release NetBox / Python compatibility lives in ## [Unreleased] +## [0.3.8] — 2026-05-19 + +### Fixed + +- **"Trace this core" button no longer appears twice on the Strand + detail page.** v0.3.7 wired the `plugin_right_page` slot into + `strand.html`, which made the `StrandTraceButton` + `PluginTemplateExtension` fire — but the template also kept the + pre-v0.3.1 inline `{% include 'netbox_osp/inc/trace_button.html' %}` + workaround, so the button rendered twice. Removed the inline + include; the extension is now the single source of truth. + ## [0.3.7] — 2026-05-19 Three audit fixes bundled together. @@ -426,7 +438,8 @@ GPS markers. - PyPI name-reservation placeholder. Not functional. -[Unreleased]: https://github.com/iamjohnnymac/netbox-osp/compare/v0.3.7...HEAD +[Unreleased]: https://github.com/iamjohnnymac/netbox-osp/compare/v0.3.8...HEAD +[0.3.8]: https://github.com/iamjohnnymac/netbox-osp/releases/tag/v0.3.8 [0.3.7]: https://github.com/iamjohnnymac/netbox-osp/releases/tag/v0.3.7 [0.3.5]: https://github.com/iamjohnnymac/netbox-osp/releases/tag/v0.3.5 [0.3.4]: https://github.com/iamjohnnymac/netbox-osp/releases/tag/v0.3.4 diff --git a/netbox_osp/__init__.py b/netbox_osp/__init__.py index c31a1c1..fce330f 100644 --- a/netbox_osp/__init__.py +++ b/netbox_osp/__init__.py @@ -5,7 +5,7 @@ class NetBoxOspConfig(PluginConfig): name = "netbox_osp" verbose_name = "NetBox OSP" description = "Outside-plant fibre management — cables, splice closures, fibre links with loss budgets, and an offline-capable Leaflet plant map." - version = "0.3.7" + version = "0.3.8" author = "John McKean" author_email = "33052970+iamjohnnymac@users.noreply.github.com" base_url = "osp" diff --git a/netbox_osp/template_content.py b/netbox_osp/template_content.py index ddbdf0a..8509fe2 100644 --- a/netbox_osp/template_content.py +++ b/netbox_osp/template_content.py @@ -110,9 +110,9 @@ def right_page(self): class StrandTraceButton(_TraceButtonMixin, PluginTemplateExtension): """Inject the trace button onto netbox-osp Strand detail pages. - Some installs disable template extensions on plugin pages — for - those, the strand.html template embeds the button directly via - {% include %}. This extension covers the standard case. + Since v0.3.1 wired plugin_right_page into strand.html this extension + is the only path; the pre-v0.3.1 inline {% include %} workaround was + removed in v0.3.8 to avoid drawing the button twice. """ models = ["netbox_osp.strand"] _trace_url_view_name = "plugins:netbox_osp:strand_trace" diff --git a/netbox_osp/templates/netbox_osp/strand.html b/netbox_osp/templates/netbox_osp/strand.html index 660e155..50e83b0 100644 --- a/netbox_osp/templates/netbox_osp/strand.html +++ b/netbox_osp/templates/netbox_osp/strand.html @@ -22,8 +22,10 @@
Strand
Loss (dB){{ object.loss_db|floatformat:3 }} - {# PR E — visual core tracer entry point #} - {% include 'netbox_osp/inc/trace_button.html' %} + {# The "Trace this core" button is rendered via the StrandTraceButton + PluginTemplateExtension into {% plugin_right_page %} below — the + pre-v0.3.1 inline include was removed in v0.3.8 to avoid drawing + the button twice once the plugin slots were wired. #} {% plugin_left_page object %}
diff --git a/pyproject.toml b/pyproject.toml index c774ca5..0b1a491 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "netbox-osp" -version = "0.3.7" +version = "0.3.8" description = "Outside-plant fibre management for NetBox — cables, splice closures, fibre links with loss budgets, and an offline-capable Leaflet plant map." authors = [{ name = "John McKean", email = "33052970+iamjohnnymac@users.noreply.github.com" }] maintainers = [{ name = "John McKean", email = "33052970+iamjohnnymac@users.noreply.github.com" }] From 525790a9f44c6072d3865cd3a78ac05ef73dcfdc Mon Sep 17 00:00:00 2001 From: iamjohnnymac <33052970+iamjohnnymac@users.noreply.github.com> Date: Tue, 19 May 2026 09:52:40 +0800 Subject: [PATCH 2/2] fix: multi-line Django comment needs {% comment %}{% endcomment %} MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The {# #} short comment is single-line only. My multi-line comment about the trace button leaked subsequent lines into template content, including a bare {% plugin_right_page %} call which Django parsed as an actual tag invocation missing its obj argument — hence the CI test failure 'plugin_right_page did not receive value for obj'. Wrapped with {% comment %}{% endcomment %} block tags. --- netbox_osp/templates/netbox_osp/strand.html | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/netbox_osp/templates/netbox_osp/strand.html b/netbox_osp/templates/netbox_osp/strand.html index 50e83b0..16cb059 100644 --- a/netbox_osp/templates/netbox_osp/strand.html +++ b/netbox_osp/templates/netbox_osp/strand.html @@ -22,10 +22,13 @@
Strand
Loss (dB){{ object.loss_db|floatformat:3 }}
- {# The "Trace this core" button is rendered via the StrandTraceButton - PluginTemplateExtension into {% plugin_right_page %} below — the - pre-v0.3.1 inline include was removed in v0.3.8 to avoid drawing - the button twice once the plugin slots were wired. #} + {% comment %} + The "Trace this core" button is rendered via the + StrandTraceButton PluginTemplateExtension into the + plugin_right_page slot below. The pre-v0.3.1 inline + include was removed in v0.3.8 to avoid drawing the button + twice once the plugin slots were wired. + {% endcomment %} {% plugin_left_page object %}