Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: validate() takes 1 positional argument but 2 were given #726

Closed
hextrim opened this issue Jan 16, 2023 · 4 comments
Closed

TypeError: validate() takes 1 positional argument but 2 were given #726

hextrim opened this issue Jan 16, 2023 · 4 comments

Comments

@hextrim
Copy link

hextrim commented Jan 16, 2023

Hi,

Every time I try to run latest of flask==2.2.2 + flask-security-too==5.0.2 or even diff combinantion of latest minor I get this error and I ran out of idea what is causing it.

I ran Getting Started: https://flask-security-too.readthedocs.io/en/stable/quickstart.html#basic-sqlalchemy-application - does not work same error.

I ran https://github.com/hrishikeshrt/flask-bootstrap-anywhere.git - does not work neither, same error.

I am wondering what I am doing wrong here that I cannot setup the project and get 500 on POST /login endpoint everytime.

python3.8
python3 -m venv venv
pip3 install -r requirements.txt from the bootstrap project or just latest flask-security-too.
running via python3 app.py or gunicorn.

Regards,
W

@hextrim
Copy link
Author

hextrim commented Jan 16, 2023

Follow up:

On python3.10 I get instead:
TypeError: LoginForm.validate() takes 1 positional argument but 2 were given

@jwag956
Copy link
Collaborator

jwag956 commented Jan 17, 2023

This seems to be due to Flask-WTForms release the other day 1.1.0 that breaks virtually every form. Pin FlaskWTF to 1.0.1 and things should start to work.

@hextrim
Copy link
Author

hextrim commented Jan 17, 2023

What a conincidence that the 1.1.0 was released 2 days ago.
In fact you were right, I thought I tried first downgrade flask_wtf to ==1.0.0 and was still having issues but, now testing with 1.0.1 and it works.

Thanks for help! Missed the so obvious.

@jwag956
Copy link
Collaborator

jwag956 commented Jan 19, 2023

Flask-WTF released 1.1.1 which should fix this.

@jwag956 jwag956 closed this as completed Jan 19, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants