diff --git a/web/views/yandex_auth.py b/web/views/yandex_auth.py index ca7b07e..c4233e4 100644 --- a/web/views/yandex_auth.py +++ b/web/views/yandex_auth.py @@ -19,17 +19,17 @@ class YandexAuthView(BaseView): 'code': code }) if response.status_code != 200: - self.logger.warning("Cant access, json: %s", response.json()) + raise Exception("Cant access, json: " + str(response.json())) return '/welcome' access_token = response.json().get('access_token') if access_token is None: - self.logger.warning('no access token') + raise Exception('no access token') return '/welcome' info_response = get('https://login.yandex.ru/info', headers={ 'Authorization': f'OAuth {access_token}' }) if info_response.status_code != 200: - self.logger.warning("Cant access, json: %s", response.json()) + raise Exception("Cant access, json: " + str(response.json())) return '/welcome' data = info_response.json() yandex_id = data['id']