DynamicModelChoiceField does not propagate required error in UI #11518

Closed
opened 2025-12-29 21:46:19 +01:00 by adam · 1 comment
Owner

Originally created by @arthanson on GitHub (Aug 22, 2025).

Deployment Type

Self-hosted

NetBox Version

v4.3.6

Python Version

3.12

Steps to Reproduce

The easiest way to show this is to modify NetBox code as there currently isn't a case where we use DynamicModelChoiceField with required.

  1. Go into netbox.dcim.forms.model_forms.SiteForm for the region = DynamicModelChoiceField for field change required=False to required=True
  2. Add a new site, set the name, slug and status. Note that Region correctly shows that it is required - don't fill anything in for Region.
  3. Click Create

Expected Behavior

The for should error and the Region field should be highlighted in red and "This field is required" should be shown below it.

Observed Behavior

The form doesn't submit, but there is no indication of why it didn't submit. There is no highlight or indication that the Region field is the problem.

Originally created by @arthanson on GitHub (Aug 22, 2025). ### Deployment Type Self-hosted ### NetBox Version v4.3.6 ### Python Version 3.12 ### Steps to Reproduce The easiest way to show this is to modify NetBox code as there currently isn't a case where we use DynamicModelChoiceField with required. 1. Go into netbox.dcim.forms.model_forms.SiteForm for the `region = DynamicModelChoiceField` for field change `required=False` to `required=True` 2. Add a new site, set the name, slug and status. Note that Region correctly shows that it is required - don't fill anything in for Region. 3. Click Create ### Expected Behavior The for should error and the Region field should be highlighted in red and "This field is required" should be shown below it. ### Observed Behavior The form doesn't submit, but there is no indication of why it didn't submit. There is no highlight or indication that the Region field is the problem.
adam added the type: bugstatus: duplicate labels 2025-12-29 21:46:19 +01:00
adam closed this issue 2025-12-29 21:46:19 +01:00
Author
Owner

@jnovinger commented on GitHub (Aug 22, 2025):

@arthanson , pretty this is a duplicate of #18916.

@jnovinger commented on GitHub (Aug 22, 2025): @arthanson , pretty this is a duplicate of #18916.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11518