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

Add explicit dependency on flask_wtf 0.13.1. #92

Open
finbarrtimbers opened this issue Jan 22, 2017 · 9 comments
Open

Add explicit dependency on flask_wtf 0.13.1. #92

finbarrtimbers opened this issue Jan 22, 2017 · 9 comments

Comments

@finbarrtimbers
Copy link

Description

flask_wtf 0.14 introduces breaking changes. I believe this is because flask_wtf doesn't use SecureForm anymore. See:

https://flask-wtf.readthedocs.io/en/stable/changelog.html#version-0-14

Steps to replicate

  1. Update flask_wtf with pip install --upgrade flask_wtf.
  2. Try to access the default registration page for stormpath-flask. It will not load.

I'll submit a PR.

finbarrtimbers added a commit to finbarrtimbers/stormpath-flask that referenced this issue Jan 22, 2017
See: stormpath#92.

Flask-WTF 0.14.0 introduces changes that break stormpath-flask. Restricting the range of packages supported fixes this until a more permanent fix can be done.
@dappiu
Copy link

dappiu commented Jan 24, 2017

I confirm that using Flask-WTF==0.14 an error comes out when trying to access the /register view, but everything works fine with Flask-WTF==0.13.1. This is the error I get:

  File "/home/dappiu/.virtualenvs/wineplan/lib/python3.6/site-packages/flask_stormpath/views.py", line 39, in register
    form = RegistrationForm(config=current_app.config)
  File "/home/dappiu/.virtualenvs/wineplan/lib/python3.6/site-packages/wtforms/form.py", line 212, in __call__
    return type.__call__(cls, *args, **kwargs)
  File "/home/dappiu/.virtualenvs/wineplan/lib/python3.6/site-packages/flask_stormpath/forms.py", line 40, in __init__
    **kwargs)
  File "/home/dappiu/.virtualenvs/wineplan/lib/python3.6/site-packages/flask_wtf/form.py", line 158, in __init__
    super(Form, self).__init__(*args, **kwargs)
TypeError: __init__() takes from 1 to 2 positional arguments but 7 were given

@chrisutpg
Copy link

I can confirm this also. Drove me nuts before seeing this issue.

@jcass77
Copy link
Contributor

jcass77 commented Feb 7, 2017

This was fixed with #90 when we switched from using Form to FlaskForm.

Have you tried using the 'develop' branch to see if that works for you?

@rdegges, it might be time to consider cutting a new release as lots of people will be forced to upgrade to Flask-WTF>=0.14 to satisfy dependencies in other Flask extensions that they may be using.

@jcass77
Copy link
Contributor

jcass77 commented Feb 7, 2017

There may be two separate issues here: the TypeError: __init__() takes from 1 to 2 positional arguments but 7 were given that @dappiu reported should not be a problem in the 'develop' branch as I said.

But I think that @finbarrtimbers was referring to another issue related to csrf_token on the /register page:

Traceback (most recent call last):
  File "/Users/jcass/PycharmProjects/barrus/barrus-otc/venv/lib/python2.7/site-packages/flask/app.py", line 1994, in __call__
    return self.wsgi_app(environ, start_response)
  File "/Users/jcass/PycharmProjects/barrus/barrus-otc/venv/lib/python2.7/site-packages/flask/app.py", line 1985, in wsgi_app
    response = self.handle_exception(e)
  File "/Users/jcass/PycharmProjects/barrus/barrus-otc/venv/lib/python2.7/site-packages/flask/app.py", line 1540, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/Users/jcass/PycharmProjects/barrus/barrus-otc/venv/lib/python2.7/site-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/jcass/PycharmProjects/barrus/barrus-otc/venv/lib/python2.7/site-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Users/jcass/PycharmProjects/barrus/barrus-otc/venv/lib/python2.7/site-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/Users/jcass/PycharmProjects/barrus/barrus-otc/venv/lib/python2.7/site-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/jcass/PycharmProjects/barrus/barrus-otc/venv/lib/python2.7/site-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/Users/jcass/PycharmProjects/barrus/barrus-otc/venv/lib/python2.7/site-packages/Flask_Stormpath-0.4.8-py2.7.egg/flask_stormpath/views.py", line 58, in register
    account = User.create(**data)
TypeError: create() got an unexpected keyword argument 'csrf_token'

@finbarrtimbers
Copy link
Author

finbarrtimbers commented Feb 7, 2017 via email

@jcass77
Copy link
Contributor

jcass77 commented Feb 7, 2017

Ah I see. #94 seems to fixe the remaining issues with the /register page.

@finbarrtimbers
Copy link
Author

Okay, great.

@rdegges
Copy link
Contributor

rdegges commented Feb 8, 2017

Sorry for the delay on this everyone. We've been working on a new release of this library internally which is revamping the configuration to support all the new Stormpath functionality. It's pretty close to completion, so I was hoping to fix all this stuff with the new major release in a couple weeks.

@jcass77
Copy link
Contributor

jcass77 commented Feb 9, 2017

@rdegges, do you think we can configure the repository to use 'develop' as the default branch instead of 'master'?

Apart from allowing us to close issues automatically via commit messages as soon as we merge, it will also reduce the likelihood of someone accidentally creating a pull request against the 'master' branch.

All of the issues reported here should now be resolved...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants