Fix TypeError in Google OAuth authenticator.

requests 1.0 changed response.json attribute to response.json()
instancemethod. The code wasn't updated to match that change,
causing a TypeError when attempting to use the Google OAuth
Authenticator backend.

This is fixed simply by using response.json() instead of response.json.
This commit is contained in:
Yuvi Panda 2015-09-25 20:25:06 -07:00 committed by Tim Abbott
parent 5dd330e769
commit b59b5cac35
1 changed files with 2 additions and 2 deletions

View File

@ -693,7 +693,7 @@ def finish_google_oauth2(request):
)
if resp.status_code != 200:
raise Exception('Could not convert google pauth2 code to access_token\r%r' % resp.text)
access_token = resp.json['access_token']
access_token = resp.json()['access_token']
resp = requests.get(
'https://www.googleapis.com/plus/v1/people/me',
@ -701,7 +701,7 @@ def finish_google_oauth2(request):
)
if resp.status_code != 200:
raise Exception('Google login failed making API call\r%r' % resp.text)
body = resp.json
body = resp.json()
try:
full_name = body['name']['formatted']