-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PROTECTION_RULES: Custom Validator does not show error message on object deletion #15652
Comments
Thank you for opening a bug report. I was unable to reproduce the reported behavior on NetBox v4.0-beta1. Please re-confirm the reported behavior on the current stable release and adjust your post above as necessary. Remember to provide detailed steps that someone else can follow using a clean installation of NetBox to reproduce the issue. Remember to include the steps taken to create any initial objects or other data. See screenshot of it showing the error on detail-view delete: |
Hi @arthanson, I amended the instructions for more clarity. The fact that you are not able to reproduce it with the 4.0-beta1 was the right hint: The problem was introduced after the "stable" beta. I was able to bisect it: (netbox) [root@dns netbox]# git bisect start
status: waiting for both good and bad commits
(netbox) [root@dns netbox]# git bisect good
status: waiting for bad commit, 1 good commit known
(netbox) [root@dns netbox]# git checkout feature
Previous HEAD position was 8d773b1b9 Add warning to beta release notes
Switched to branch 'feature'
Your branch is up to date with 'origin/feature'.
(netbox) [root@dns netbox]# git bisect bad
Bisecting: 3 revisions left to test after this (roughly 2 steps)
[99fe63569dc5f2024a887b5eaf20efc534ceaeea] Fixes #15617: Fix rack elevation styling under dark mode
(netbox) [root@dns netbox]# systemctl restart netbox netbox-rq
(netbox) [root@dns netbox]# git bisect good
Bisecting: 1 revision left to test after this (roughly 1 step)
[d34f188d40b11d7d70d5d46cbc3f9accb2d876a8] Fixes #15637: Fix rendering of links from within embedded tables w/HTMX enabled (#15642)
(netbox) [root@dns netbox]# systemctl restart netbox netbox-rq
(netbox) [root@dns netbox]# git bisect bad
Bisecting: 0 revisions left to test after this (roughly 0 steps)
[ccca0580f7835387137e880f41f2a0eab0beb500] Fixes #15619: Enforce a minimum width for progress bars
(netbox) [root@dns netbox]# systemctl restart netbox netbox-rq
(netbox) [root@dns netbox]# git bisect good
d34f188d40b11d7d70d5d46cbc3f9accb2d876a8 is the first bad commit
commit d34f188d40b11d7d70d5d46cbc3f9accb2d876a8
Author: Jeremy Stretch <[email protected]>
Date: Fri Apr 5 14:22:09 2024 -0400
Fixes #15637: Fix rendering of links from within embedded tables w/HTMX enabled (#15642)
* Add htmx_table to __all__
* Fix dropdown menu clipping
* Fix loading links from within embedded tables
* Fix rendering of object deletion warning
netbox/netbox/views/generic/object_views.py | 2 +-
netbox/templates/generic/object_delete.html | 2 +-
netbox/templates/inc/table_htmx.html | 3 +--
netbox/utilities/htmx.py | 2 +-
netbox/utilities/templates/builtins/htmx_table.html | 2 +-
netbox/utilities/templatetags/builtins/tags.py | 1 +
6 files changed, 6 insertions(+), 6 deletions(-) |
So it looks like it is getting run, but the message just flashes and goes away - if you look quickly you can spot it at the bottom. |
Could you please assign it to me? |
I suspect the embedded services table is causing the error toasts to be cleared out when it's loaded. If you remove it from the |
Deployment Type
Self-hosted
NetBox Version
v4.0-beta1 (commit c7f6c20)
Python Version
3.11
Steps to Reproduce
and store as
/opt/netbox/validators/test.py
IPAddress
objects:Expected Behavior
The IP address is not deleted, an error message is shown saying "Do not delete IP addresses!"
Observed Behavior
The IP address is not deleted, but there is no error message.
The error message is, however, displayed when one tries to delete an IP address using the bulk edit view:
The text was updated successfully, but these errors were encountered: