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

AttributeError when login form does not validate.

erikberglund opened this issue · comments

I get the following error when a user tries to log in with invalid credentials:

ERROR:flask.app:Exception on /api/auth/login [POST]
Traceback (most recent call last):
    File "/var/www/site/backend/auth/api.py", line 42, in post
        if form.validate_ldap():
    File "/var/www/site/venv/lib/python3.6/site-packages/flask_ldap3_login/forms.py", line 51, in validate_ldap
        self.username.errors.append('Invalid Username/Password.')
AttributeError: 'tuple' object has no attribute 'append'

So something might have changed in a WTForms update to make the errors object a tuple?

I'm using:

  • Python 3.6
  • flask-ldap3-login 0.9.16
  • WTForms 2.2.1

That seems like a reasonable hypothesis. Next action here is probably to investigate the Flask-WTF and WTForms change logs to identify an appropriate minimum version.