Another bug fix

This commit is contained in:
Edward Betts 2019-09-27 20:08:54 +01:00
parent 57e2f46d77
commit 83b8792eaa

6
app.py
View file

@ -245,8 +245,10 @@ def get_username():
return session['username']
params = {'action': 'query', 'meta': 'userinfo', 'format': 'json'}
r = oauth_api_request(params)
session['username'] = r.json()['query']['userinfo']['name']
reply = oauth_api_request(params)
if 'query' not in reply:
return
session['username'] = reply['query']['userinfo']['name']
return session['username']