Old MESSAGE_TAGS in netbox/settings.py causes error messages to be displayed as info message #7285

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

Originally created by @TheDJVG on GitHub (Nov 25, 2022).

Originally assigned to: @arthanson on GitHub.

NetBox version

v3.3.8

Python version

3.10

Steps to Reproduce

I noticed this bug only during plugin development so I use a place in NetBox that is easy to reproduce.

  1. Add a new circuit without terminations.
  2. Once on the circuit detail page append /terminations/swap/ to the URL.
  3. The error "No terminations have been defined for circuit test."

I believe this happens because the original NetBox release used MESSAGE_TAGS in settings.py:
b1da374df2/netbox/netbox/settings.py (L418-L421)
This is here since the original public release. Way before the template tag status_from_tag was used in v3.0:
b1da374df2/netbox/utilities/templatetags/helpers.py (L209-L221)
That's used for toasts:
b1da374df2/netbox/templates/inc/messages.html (L44)

Based on this I believe removing MESSAGE_TAGS from netbox/settings.py is enough to restore the expected behavior.

Expected Behavior

The error message should be displayed as an error (in red).

Observed Behavior

The error message is displayed as an info message (in blue).

Originally created by @TheDJVG on GitHub (Nov 25, 2022). Originally assigned to: @arthanson on GitHub. ### NetBox version v3.3.8 ### Python version 3.10 ### Steps to Reproduce I noticed this bug only during plugin development so I use a place in NetBox that is easy to reproduce. 1. Add a new circuit without terminations. 2. Once on the circuit detail page append `/terminations/swap/` to the URL. 3. The error "No terminations have been defined for circuit test." I believe this happens because the original NetBox release used `MESSAGE_TAGS` in settings.py: https://github.com/netbox-community/netbox/blob/b1da374df201a06daa90a3c462fafd42cfa6ed9b/netbox/netbox/settings.py#L418-L421 This is here since the [original public release](https://github.com/netbox-community/netbox/blame/c2d0e8fd9557252e348fe938400de4c5c86f079d/netbox/netbox/settings.py#L281). Way before the template tag `status_from_tag` was used in v3.0: https://github.com/netbox-community/netbox/blob/b1da374df201a06daa90a3c462fafd42cfa6ed9b/netbox/utilities/templatetags/helpers.py#L209-L221 That's used for toasts: https://github.com/netbox-community/netbox/blob/b1da374df201a06daa90a3c462fafd42cfa6ed9b/netbox/templates/inc/messages.html#L44 Based on this I believe removing `MESSAGE_TAGS` from `netbox/settings.py` is enough to restore the expected behavior. ### Expected Behavior The error message should be displayed as an error (in red). ### Observed Behavior The error message is displayed as an info message (in blue).
adam added the type: bugstatus: needs owner labels 2025-12-29 20:21:14 +01:00
adam closed this issue 2025-12-29 20:21:14 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7285