Skip to content

Broken with Flask-WTF v0.14.x #294

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

Closed
logsoft opened this issue Jan 22, 2017 · 9 comments
Closed

Broken with Flask-WTF v0.14.x #294

logsoft opened this issue Jan 22, 2017 · 9 comments
Labels
type: bug Something isn't working

Comments

@logsoft
Copy link

logsoft commented Jan 22, 2017

happened in working code after flask pip upgrade.

setup: (only related)
Flask (0.12)
Flask-Admin (1.4.2)
Flask-DebugToolbar (0.10.0)
Flask-Login (0.4.0)
Flask-Markdown (0.3)
flask-mongoengine (0.8.2)
Flask-WTF (0.14.2)
itsdangerous (0.24)
Jinja2 (2.9.4)
mongoengine (0.11.0)
pymongo (3.4.0)
Werkzeug (0.11.15)
WTForms (2.1)

File "..../blog/views.py", line 34, in get_context
    form = self.form(request.form)
File "..../local/lib/python2.7/site-packages/wtforms/form.py", line 212, in __call__
    return type.__call__(cls, *args, **kwargs)
File "..../local/lib/python2.7/site-packages/flask_mongoengine/wtf/models.py", line 12, in __init__
    super(ModelForm, self).__init__(formdata, obj, **kwargs)
TypeError: __init__() takes at most 2 arguments (3 given)

changing line 12 in flask_mongoengine/wtf/models.py from

        super(ModelForm, self).__init__(formdata, obj, **kwargs)

to:

        super(ModelForm, self).__init__(formdata, **kwargs)

solves the problem.
But i dont really know if this is the solution or just masking an error of my app.

@lafrech
Copy link
Member

lafrech commented Jan 22, 2017

Thanks for reporting. I had a quick look. There's been important changes in Flask-WTForms recently. See this commit, which is released in v0.14.

I just relaunched the tests for latest flask-mongoengine commit and they fail: https://travis-ci.org/MongoEngine/flask-mongoengine/builds/187515401

I'd say stick to Flask-WTF v0.13.x until flask-mongoengine is fixed for v0.14 (help welcome).

@lafrech lafrech added the type: bug Something isn't working label Jan 22, 2017
@lafrech lafrech changed the title wrong super call? missed change in wtf form? Broken with Flask-WTF v0.14.x Jan 22, 2017
@wojcikstefan
Copy link
Member

@lafrech did you reran the tests on the master branch? The badge still says that the tests are passing for me.

@lafrech
Copy link
Member

lafrech commented Jan 22, 2017

@wojcikstefan they're still running. (You're too fast!)

@wojcikstefan
Copy link
Member

Haha, alright, will take a look soon. Thank you for reporting @logsoft !

@logsoft
Copy link
Author

logsoft commented Jan 22, 2017

Thanks for the info! will revert to flask-wtf 0.13 for now.
For helping out with this my knowledge of flask and web programming sadly is not sufficient enough.

@eunicekokor
Copy link

Also having this issue!

@lafrech
Copy link
Member

lafrech commented Jan 30, 2017

@eunicekokor Then you're welcome to provide a PR with a fix. I don't mean to be impolite, but note you can use those emoji "reactions" like "thumb-up" as a replacement for "me too" comments to limit email noise for those watching the repo.

@wojcikstefan, none of us seems to have time to take care of this. Would you like to pin flask-wtf version in setup.py in the meantime?

@lafrech lafrech closed this as completed in 91d42c1 Feb 7, 2017
@lafrech
Copy link
Member

lafrech commented Feb 7, 2017

@logsoft, @eunicekokor, can you please confirm latest version in master fixes your issue?

It would be nice to have your feedback before releasing 0.9.1 with the fix.

@logsoft
Copy link
Author

logsoft commented Feb 7, 2017

@lafrech will try these days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants