This commit is contained in:
Edward Betts 2019-09-29 21:37:17 +01:00
parent 42b78da7e3
commit 3d63b6f9f6

4
app.py
View file

@ -321,7 +321,7 @@ def oauth_api_request(params):
client_secret=client_secret, client_secret=client_secret,
resource_owner_key=session['owner_key'], resource_owner_key=session['owner_key'],
resource_owner_secret=session['owner_secret']) resource_owner_secret=session['owner_secret'])
r = oauth.get(url) r = oauth.get(url, timeout=2)
reply = r.json() reply = r.json()
return reply return reply
@ -349,7 +349,7 @@ def get_token():
'format': 'json', 'format': 'json',
'formatversion': 2, 'formatversion': 2,
} }
reply = oauth_api_request(params, timeout=2) reply = oauth_api_request(params)
token = reply['query']['tokens']['csrftoken'] token = reply['query']['tokens']['csrftoken']
return token return token