Here is my code:
class ChangeOfficialForm(Form):
is_official = SelectField(
'Officially Approved',
choices=[(True, 'Yes'), (False, 'No')],
validators=[DataRequired()],
coerce=bool
)
submit = SubmitField('Update status')
For some reason, is_official.data
is always True
. I suspect that I am misunderstanding how coercing works.