Skip to content

Commit f655bbd

Browse files
committed
Avoid setting user_token to None
1 parent 055662b commit f655bbd

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/saic_ismart_client_ng/api/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ async def __deserialize(
211211
raise SaicApiException(f"Failed to deserialize response: {e}. Original json was {response.text}") from e
212212

213213
def logout(self):
214-
self.__api_client.user_token = None
214+
self.__api_client.user_token = ''
215215
self.__token_expiration = None
216216

217217
@property

src/saic_ismart_client_ng/net/client/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ def __init__(
1919
self.__configuration = configuration
2020
self.__listener = listener
2121
self.__logger = logger
22-
self.__user_token = ""
23-
self.__class_name = ""
22+
self.__user_token: str = ''
23+
self.__class_name: str = ''
2424
self.__client = httpx.AsyncClient(
2525
event_hooks={
2626
"request": [self.__invoke_request_listener, self.__encrypt_request],

src/saic_ismart_client_ng/net/crypto.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ def encrypt_request(
5959
user_token: str = "",
6060
class_name: str = "",
6161
) -> (str, dict):
62+
if user_token is None:
63+
user_token = ""
64+
if class_name is None:
65+
class_name = ""
6266
original_content_type = original_request_headers.get("Content-Type") # 'application/x-www-form-urlencoded'
6367
if not original_content_type:
6468
modified_content_type = "application/json"

0 commit comments

Comments
 (0)