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():