From 7f9ca0e72e121b2b3fe0a5232ee386654fee9312 Mon Sep 17 00:00:00 2001 From: oksana-slu Date: Tue, 5 Feb 2019 16:10:05 +0200 Subject: [PATCH] Fix hardcode email --- edx_oauth_client/backends/generic_oauth_client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/edx_oauth_client/backends/generic_oauth_client.py b/edx_oauth_client/backends/generic_oauth_client.py index 205b007..9363c32 100644 --- a/edx_oauth_client/backends/generic_oauth_client.py +++ b/edx_oauth_client/backends/generic_oauth_client.py @@ -121,7 +121,8 @@ def get_user_id(self, details, response): if 'data' in response: id_key = response['data'][0].get(self.ID_KEY) else: - id_key = response.get('email') + id_key = response.get(self.ID_KEY) + if not id_key: log.error("ID_KEY is not found in the User data response. SSO won't work correctly") return id_key