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

Fix wrong evaluation of boolean kwargs #824

Merged
merged 3 commits into from
Mar 28, 2016
Merged

Fix wrong evaluation of boolean kwargs #824

merged 3 commits into from
Mar 28, 2016

Conversation

falknes
Copy link
Contributor

@falknes falknes commented Jan 19, 2016

After spending too much time debugging why my extra entry in SOCIAL_AUTH_USER_FIELDS was None, if figured out that the issue lies in social.pipeline.create_user. If the extra field in SOCIAL_AUTH_USER_FIELDS is a boolean evaluated to False, and it´s provided in kwargs, it will return None instead of the correct False value.

>>> kwargs = {'field': False}
>>> details = {}
>>> results = kwargs.get('field') or details.get('field')
>>> print(results)
None
>>> results = kwargs.get('field', details.get('field'))
>>> print(results)
False

@omab omab merged commit bedef0c into omab:master Mar 28, 2016
@omab
Copy link
Owner

omab commented Mar 28, 2016

Thanks!

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

Successfully merging this pull request may close these issues.

3 participants