Open pmcknig1 opened 2 years ago
looks like wtforms.validators split the Required into DataRequired and InputRequired in version version 1.0.2
Looks like changing lines 59, 60, 79, and 81 from
login = fields.StringField(validators=[validators.required()])
password = fields.PasswordField(validators=[validators.required()])
and
login = fields.StringField(validators=[validators.required()])
email = fields.StringField()
password = fields.PasswordField(validators=[validators.required()])
to:
login = fields.StringField(validators=[validators.InputRequired()])
password = fields.PasswordField(validators=[validators.InputRequired()])
login = fields.StringField(validators=[validators.InputRequired()])
email = fields.StringField()
password = fields.PasswordField(validators=[validators.InputRequired()])
fixes the issue.
I would also suggest when getting a working example again, running pip freeze > examples/auth-flask-login/requirements.txt
so that specific module version are saved. That way the examples are future proofed for the next set of people to clone the repository.
It looks like this was fixed by https://github.com/flask-admin/flask-admin/pull/2308. Consider closing.
Running the
auth-flask-admin
example errors with the following `AttributeError: module 'wtforms.validators' has no attribute 'required'This is directly after pip installing the requirements and running
python examples/auth-flask-login/app.py
The console output is below.
and pip freeze just to show to correct
requirements.txt
was used.