[PR #18100] [MERGED] 18044 enable alert for plugins in script #15275

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/18100
Author: @arthanson
Created: 11/25/2024
Status: Merged
Merged: 12/2/2024
Merged by: @jeremystretch

Base: developHead: 18044-script-alert


📝 Commits (1)

  • 771c633 18044 enable alert for plugins in script

📊 Changes

1 file changed (+4 additions, -0 deletions)

View changed files

📝 netbox/extras/views.py (+4 -0)

📄 Description

Fixes: #18044

script.html already derives from generic/object.html which has the plugin alert include, the issue was that the alert is keyed off of the context var object and the view uses script. It isn't really DRY to pass in both object and script, but to change would require it to change in the template extras/script/base.html which is included in other templates and this would cause the the branching message to also appear in those templates which isn't desired. We could then mask that out in the template include, but this way just keeps it isolated.

Note: This will not display anything without changes in the branching plugin which will be in a separate PR for that project. Screenshot shown with change in branching plugin to enable an alert here.

New Branch | NetBox 2024-11-25 08-52-37


🔄 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/18100 **Author:** [@arthanson](https://github.com/arthanson) **Created:** 11/25/2024 **Status:** ✅ Merged **Merged:** 12/2/2024 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `18044-script-alert` --- ### 📝 Commits (1) - [`771c633`](https://github.com/netbox-community/netbox/commit/771c633b13c898278c62f20dc634a639ec11c3a6) 18044 enable alert for plugins in script ### 📊 Changes **1 file changed** (+4 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `netbox/extras/views.py` (+4 -0) </details> ### 📄 Description ### Fixes: #18044 script.html already derives from generic/object.html which has the plugin alert include, the issue was that the alert is keyed off of the context var `object` and the view uses `script`. It isn't really DRY to pass in both object and script, but to change would require it to change in the template extras/script/base.html which is included in other templates and this would cause the the branching message to also appear in those templates which isn't desired. We could then mask that out in the template include, but this way just keeps it isolated. **Note:** This will not display anything without changes in the branching plugin which will be in a separate PR for that project. Screenshot shown with change in branching plugin to enable an alert here. ![New Branch | NetBox 2024-11-25 08-52-37](https://github.com/user-attachments/assets/eb2fc513-1fd2-416e-b7fb-baea5bb697b9) --- <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:21:01 +01:00
adam closed this issue 2025-12-30 00:21:01 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15275