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

removing Response include and some minor PEP8 compliance. #76

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions flask_oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@
import httplib2
from functools import wraps
from urlparse import urljoin
from flask import request, session, json, redirect, Response
from flask import request, session, json, redirect
from werkzeug import url_decode, url_encode, url_quote, \
parse_options_header, Headers
parse_options_header, Headers
import oauth2


_etree = None


def get_etree():
"""Return an elementtree implementation. Prefers lxml"""
global _etree
Expand Down Expand Up @@ -293,7 +294,7 @@ def generate_request_token(self, callback=None):
callback = urljoin(request.url, callback)
resp, content = self._client.request_new_token(
self.expand_url(self.request_token_url), callback,
self.request_token_params)
self.request_token_params)
if not self.status_okay(resp):
raise OAuthException('Failed to generate request token',
type='token_generation_failed')
Expand Down Expand Up @@ -393,9 +394,10 @@ def handle_oauth2_response(self):
}
remote_args.update(self.access_token_params)
if self.access_token_method == 'POST':
resp, content = self._client.request(self.expand_url(self.access_token_url),
self.access_token_method,
url_encode(remote_args))
resp, content = self._client.request(
self.expand_url(self.access_token_url),
self.access_token_method,
url_encode(remote_args))
elif self.access_token_method == 'GET':
url = add_query(self.expand_url(self.access_token_url), remote_args)
resp, content = self._client.request(url, self.access_token_method)
Expand Down