Skip to content

DynamicModelChoiceField doesn't render error message on submit #18916

Open
@chii0815

Description

@chii0815

Deployment Type

Self-hosted

NetBox Version

v.4.2.5

Python Version

3.11

Steps to Reproduce

While developing a plugin I realized that the DynamicModelChoiceField doesn't display an error if required=True and the nothing is selected. The form just doesn't submit and the view doesn't give a hint why.

  1. create a form with two choice fields (one django.forms.ModelChoiceField and one DynamicModelChoiceField)
  2. set both to be required

Expected Behavior

When both are empty the form should show an error message on submit

Observed Behavior

only the forms.ModelChoiceField shows an error message

Image

Metadata

Metadata

Assignees

Labels

severity: lowDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions