nickw444 / flask-ldap3-login

LDAP3 Logins for Flask/Flask-Login

Home Page:http://flask-ldap3-login.readthedocs.org/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DeprecationWarning: Required is going away in WTForms 3.0, use DataRequired

vladciobancai opened this issue ยท comments

Hi,

After updating the Flask / Flask-WTF and WTForms i receive the following warning

2019-10-08 15:28:30,129 - INFO -  * Restarting with stat MainThread
/usr/local/lib/python3.7/site-packages/flask_wtf/recaptcha/widgets.py:5: DeprecationWarning: The import 'werkzeug.url_encode' is deprecated and will be removed in Werkzeug 1.0. Use 'from werkzeug.urls import url_encode' instead.
  from werkzeug import url_encode
/usr/local/lib/python3.7/site-packages/flask_ldap3_login/forms.py:26: DeprecationWarning: Required is going away in WTForms 3.0, use DataRequired
  username = wtforms.StringField('Username', validators=[validators.Required()])

If you think to fix it and to release a new build.

We should find out what version of WTForms introduced the DataRequired validator and set a minimum version requirement on that version.

https://wtforms.readthedocs.io/en/stable/changes.html#version-1-0-2
looks like version 1.0.2 split the Required into DataRequired and InputRequired.
Also per lots of posts I've read while looking into it, the FlaskForm should use InputRequired not DataRequired.
DataRequired could return false if, for example, a 0 was entered.

Hi! WTForms v3.0 has been released yesterday and this became a bug I'm afraid.

Hey @northwestwitch, I've released a pre-release, 0.9.17b1. Could you please try this out? (pip install flask-ldap3-login==0.9.17b1). If it appears to work as expected, I'll proceed to release it as a public release.

Tested with my app and it works fine (no complaints or error messages so far)! ๐Ÿ‘๐Ÿป

Right version of this software is installed: ๐Ÿ†—
image

My app works: ๐Ÿ†—
image

Before it didn't: Clinical-Genomics/scout#2961 (comment)

Great to hear, I'll put out a mainline release this evening. Thanks for testing and confirming @northwestwitch

0.9.17 is now live on Pypi. pip install flask-ldap3-login==0.9.17