[PR #20019] [MERGED] Fixes #19986: Fix plugin list view button URLs #15794

Closed
opened 2025-12-30 00:24:06 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/20019
Author: @jnovinger
Created: 8/4/2025
Status: Merged
Merged: 8/5/2025
Merged by: @jeremystretch

Base: featureHead: 19986-fix-plugin-list-view-buttons


📝 Commits (2)

  • cbf769e Fixes #19986: Fix plugin list view button URLs
  • b97ac23 Ensure expected URL patterns are registered, ensures tests pass

📊 Changes

3 files changed (+37 additions, -1 deletions)

View changed files

📝 netbox/netbox/object_actions.py (+2 -1)
📝 netbox/netbox/tests/dummy_plugin/urls.py (+3 -0)
netbox/netbox/tests/test_object_actions.py (+32 -0)

📄 Description

Fixes: #19986

Plugin list view action buttons (Add, Import, Export) were generating 404 errors because ObjectAction.get_url() was manually constructing view names without the required "plugins:" namespace prefix for plugin models.

Replace manual view name construction with NetBox's get_viewname() utility function, which properly handles plugin detection and namespace prefixing for both core and plugin models.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/20019 **Author:** [@jnovinger](https://github.com/jnovinger) **Created:** 8/4/2025 **Status:** ✅ Merged **Merged:** 8/5/2025 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `feature` ← **Head:** `19986-fix-plugin-list-view-buttons` --- ### 📝 Commits (2) - [`cbf769e`](https://github.com/netbox-community/netbox/commit/cbf769e2efe183c2611f35134f8d85e73d47874a) Fixes #19986: Fix plugin list view button URLs - [`b97ac23`](https://github.com/netbox-community/netbox/commit/b97ac23a6d0800efa944cdff53d4bdd327c1b614) Ensure expected URL patterns are registered, ensures tests pass ### 📊 Changes **3 files changed** (+37 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `netbox/netbox/object_actions.py` (+2 -1) 📝 `netbox/netbox/tests/dummy_plugin/urls.py` (+3 -0) ➕ `netbox/netbox/tests/test_object_actions.py` (+32 -0) </details> ### 📄 Description ### Fixes: #19986 Plugin list view action buttons (Add, Import, Export) were generating 404 errors because ObjectAction.get_url() was manually constructing view names without the required "plugins:" namespace prefix for plugin models. Replace manual view name construction with NetBox's get_viewname() utility function, which properly handles plugin detection and namespace prefixing for both core and plugin models. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 00:24:06 +01:00
adam closed this issue 2025-12-30 00:24:06 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15794