diff options
author | Ib Lundgren <ib.lundgren@gmail.com> | 2012-06-29 13:59:29 +0200 |
---|---|---|
committer | Ib Lundgren <ib.lundgren@gmail.com> | 2012-06-29 13:59:29 +0200 |
commit | 10c5896005de940c0c6f85834b0e4560daf1744d (patch) | |
tree | eee9d1b5832cea857ada44f25e4e56793da161e0 | |
parent | b765eb5ba4b8ce40fcbb6f76fbccb0285b0d87cd (diff) | |
download | oauthlib-10c5896005de940c0c6f85834b0e4560daf1744d.tar.gz |
Only add not None extra values
-rw-r--r-- | oauthlib/oauth2/draft25/parameters.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/oauthlib/oauth2/draft25/parameters.py b/oauthlib/oauth2/draft25/parameters.py index ecc9f63..fd3ebcd 100644 --- a/oauthlib/oauth2/draft25/parameters.py +++ b/oauthlib/oauth2/draft25/parameters.py @@ -58,7 +58,8 @@ def prepare_grant_uri(uri, client_id, response_type, redirect_uri=None, params.append((u'state', state)) for k in kwargs: - params.append((unicode(k), kwargs[k])) + if kwargs[k]: + params.append((unicode(k), kwargs[k])) return add_params_to_uri(uri, params) @@ -87,7 +88,8 @@ def prepare_token_request(grant_type, body=u'', **kwargs): """ params = [(u'grant_type', grant_type)] for k in kwargs: - params.append((unicode(k), kwargs[k])) + if kwargs[k]: + params.append((unicode(k), kwargs[k])) return add_params_to_qs(body, params) |