Commit 34f4a6e1 authored by Liran Zvibel's avatar Liran Zvibel

Use InputRequired instead of deprecated Required wtform validator

InputRequired allows value of '0' as an IntegerField value.
parent e06d55d3
......@@ -78,7 +78,7 @@ class AdminModelConverter(ModelConverterBase):
if local_column.nullable:
kwargs['validators'].append(validators.Optional())
elif prop.direction.name != 'MANYTOMANY':
kwargs['validators'].append(validators.Required())
kwargs['validators'].append(validators.InputRequired())
# Override field type if necessary
override = self._get_field_override(prop.key)
......@@ -153,7 +153,7 @@ class AdminModelConverter(ModelConverterBase):
column))
if not column.nullable and not isinstance(column.type, Boolean):
kwargs['validators'].append(validators.Required())
kwargs['validators'].append(validators.InputRequired())
# Apply label and description if it isn't inline form field
if self.view.model == mapper.class_:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment