WirelessLink model validation references wrong field #11267

Closed
opened 2025-12-29 21:42:41 +01:00 by adam · 2 comments
Owner

Originally created by @pheus on GitHub (Jun 6, 2025).

Originally assigned to: @pheus on GitHub.

Deployment Type

Self-hosted

NetBox Version

v4.3.2

Python Version

3.11

Steps to Reproduce

  1. Create two wireless-capable interfaces on two different devices (e.g., type = "802.11be").
  2. Create one valid WirelessLink using those interfaces — this should succeed.
  3. Attempt to create a WirelessLink using an invalid (non-wireless) interface for interface_b, while keeping interface_a valid.
  4. Submit the form or API request.

Expected Behavior

A ValidationError should be raised indicating that interface_b is not a valid wireless interface.

The error should appear on the interface_b field as:

interface_b: "<type> is not a wireless interface."

Observed Behavior

Instead, the ValidationError appears on the interface_a field even though it is interface_b that is invalid.

0e68901022/netbox/wireless/models.py (L207-L212)

This creates confusion because the message doesn't correspond to the actual invalid field.

Originally created by @pheus on GitHub (Jun 6, 2025). Originally assigned to: @pheus on GitHub. ### Deployment Type Self-hosted ### NetBox Version v4.3.2 ### Python Version 3.11 ### Steps to Reproduce 1. Create two wireless-capable interfaces on two different devices (e.g., type = "802.11be"). 2. Create one valid `WirelessLink` using those interfaces — this should succeed. 3. Attempt to create a `WirelessLink` using an invalid (non-wireless) interface for `interface_b`, while keeping `interface_a` valid. 4. Submit the form or API request. ### Expected Behavior A `ValidationError` should be raised indicating that `interface_b` is not a valid wireless interface. The error should appear on the `interface_b` field as: ``` interface_b: "<type> is not a wireless interface." ``` ### Observed Behavior Instead, the `ValidationError` appears on the `interface_a` field even though it is `interface_b` that is invalid. https://github.com/netbox-community/netbox/blob/0e689010225a14770f1dec5390de49ca43a0960c/netbox/wireless/models.py#L207-L212 This creates confusion because the message doesn't correspond to the actual invalid field.
adam added the type: bugstatus: acceptedseverity: low labels 2025-12-29 21:42:41 +01:00
adam closed this issue 2025-12-29 21:42:41 +01:00
Author
Owner

@pheus commented on GitHub (Jun 6, 2025):

I've noticed this while analyzing Feature Request #19499.

I'd be happy to submit a fix for this.

@pheus commented on GitHub (Jun 6, 2025): I've noticed this while analyzing Feature Request [#19499](https://github.com/netbox-community/netbox/issues/19499). I'd be happy to submit a fix for this.
Author
Owner

@jeremystretch commented on GitHub (Jun 6, 2025):

Thanks @pheus!

@jeremystretch commented on GitHub (Jun 6, 2025): Thanks @pheus!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11267