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:
2017-10-17 12:14:12 +02:00
parent 72f440f509
commit cfbb05530a

View File

@@ -186,11 +186,14 @@ def fetch_blenderid_user() -> dict:
bid_url = '%s/api/user' % blender_id_endpoint()
log.debug('Fetching user info from %s', bid_url)
try:
client_id = current_app.config['OAUTH_CREDENTIALS']['blender-id']['id']
client_secret = current_app.config['OAUTH_CREDENTIALS']['blender-id']['secret']
credentials = current_app.config['OAUTH_CREDENTIALS']['blender-id']
oauth_token = session['blender_id_oauth_token']
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)
except httplib2.HttpLib2Error:
log.exception('Error getting %s from BlenderID', bid_url)