Added some type checks before assigning to session['blender_id_oauth_token']

There were some sporadic TypeErrors where the session var was set to a
tuple instead of a string; this is a way to figure out where that happens.
This commit is contained in:
2017-10-17 12:16:20 +02:00
parent cfbb05530a
commit a897282400
2 changed files with 6 additions and 1 deletions

View File

@@ -189,6 +189,8 @@ def fetch_blenderid_user() -> dict:
credentials = current_app.config['OAUTH_CREDENTIALS']['blender-id']
oauth_token = session['blender_id_oauth_token']
assert isinstance(oauth_token, str), f'oauth token must be str, not {type(oauth_token)}'
oauth_session = OAuth2Session(
credentials['id'], credentials['secret'],
access_token=oauth_token)