From 72b82426c034ddd5ec5d925f751dfdd72e95b999 Mon Sep 17 00:00:00 2001 From: Francis Date: Sat, 25 Jul 2020 01:04:58 +0200 Subject: [PATCH] cleanup --- oauth/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/oauth/views.py b/oauth/views.py index 37c8643..0bdad92 100644 --- a/oauth/views.py +++ b/oauth/views.py @@ -66,7 +66,7 @@ def get_access_token(code): 'client_secret': settings.OAUTH["CLIENT_SECRET"], 'redirect_uri': settings.OAUTH["REDIRECT_URI"]}, headers={'Referer': f'{settings.SERVER_URL}/login/zeus/register'}) - if response.status_code is not 200: + if response.status_code != 200: raise OAuthException( f'Status code {response.status_code} when requesting access token.\nresponse: {response.text}') if 'access_token' not in response.json(): @@ -79,7 +79,7 @@ def get_user_info(access_token): settings.OAUTH["USER_API_URI"], headers={'Authorization': f'Bearer {access_token}'}, ) - if response.status_code is not 200: + if response.status_code != 200: raise OAuthException( f'Status code {response.status_code} when requesting user info.\nresponse: {response.text}') if 'username' not in response.json() or 'id' not in response.json():