Taken unrelated code out of try-body.
The try-body should only contain code that can actually raise the caught exception.
This commit is contained in:
@@ -186,11 +186,14 @@ def fetch_blenderid_user() -> dict:
|
|||||||
|
|
||||||
bid_url = '%s/api/user' % blender_id_endpoint()
|
bid_url = '%s/api/user' % blender_id_endpoint()
|
||||||
log.debug('Fetching user info from %s', bid_url)
|
log.debug('Fetching user info from %s', bid_url)
|
||||||
try:
|
|
||||||
client_id = current_app.config['OAUTH_CREDENTIALS']['blender-id']['id']
|
credentials = current_app.config['OAUTH_CREDENTIALS']['blender-id']
|
||||||
client_secret = current_app.config['OAUTH_CREDENTIALS']['blender-id']['secret']
|
oauth_token = session['blender_id_oauth_token']
|
||||||
oauth_session = OAuth2Session(
|
oauth_session = OAuth2Session(
|
||||||
client_id, client_secret, access_token=session['blender_id_oauth_token'])
|
credentials['id'], credentials['secret'],
|
||||||
|
access_token=oauth_token)
|
||||||
|
|
||||||
|
try:
|
||||||
bid_resp = oauth_session.get(bid_url)
|
bid_resp = oauth_session.get(bid_url)
|
||||||
except httplib2.HttpLib2Error:
|
except httplib2.HttpLib2Error:
|
||||||
log.exception('Error getting %s from BlenderID', bid_url)
|
log.exception('Error getting %s from BlenderID', bid_url)
|
||||||
|
Reference in New Issue
Block a user