You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created a form which contains a select field, based on a column that is both non-nullable and has a default specified on the entity. When the field is rendered by the default form rendering, it contains a blank value (by design) but when that blank value is selected and the form submitted, there is no validation happening, and an integrity error results: null value in column violates not-null constraint
The workaround is to specify the SelectField explicitly and include validators=[InputRequired()]
The text was updated successfully, but these errors were encountered:
I think we'll need more details here or an example. If I'm understanding correctly, a blank value option is included in the list by design, and the model has a default. In that case, the model form generator should be setting up the field without an input requirement, because of the entity default.
When the form is submitted, the entity default value should kick in and apply to the record.
I created a form which contains a select field, based on a column that is both non-nullable and has a default specified on the entity. When the field is rendered by the default form rendering, it contains a blank value (by design) but when that blank value is selected and the form submitted, there is no validation happening, and an integrity error results:
null value in column violates not-null constraint
The workaround is to specify the
SelectField
explicitly and includevalidators=[InputRequired()]
The text was updated successfully, but these errors were encountered: