-
Notifications
You must be signed in to change notification settings - Fork 34
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
Cannot send meta=None in from_json to flask-wtf>=0.14 #47
Comments
Looks like a bug in Flask-WTF: |
Arguably, the definition in WTForms also has meta=None, but it's doc at http://wtforms.readthedocs.io/en/latest/forms.html#wtforms.form.Form.__init__ says: meta – If provided, this is a dictionary of values to override attributes on this form’s meta instance. |
You're right, just created #48 to fix this. |
@alanhamlett, it shows as a 'referenced' item here. pallets-eco/flask-wtf#278 |
The classmethod from_json has default meta=None, which fails at https://github.com/lepture/flask-wtf/blob/master/flask_wtf/form.py#L85 as that assumes meta is a dict if present:
File "/usr/local/lib/python2.7/dist-packages/wtforms_json/init.py", line 233, in from_json
**kwargs
File "/usr/local/lib/python2.7/dist-packages/wtforms/form.py", line 212, in call
return type.call(cls, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/flask_wtf/form.py", line 85, in init
kwargs.setdefault('meta', {}).setdefault('csrf', csrf_enabled)
AttributeError: 'NoneType' object has no attribute 'setdefault'
The text was updated successfully, but these errors were encountered: