From 71c70592b222577b136ea36e663b3971c016706a Mon Sep 17 00:00:00 2001 From: Inex Code Date: Fri, 24 Jun 2022 19:35:42 +0300 Subject: [PATCH] fixes --- selfprivacy_api/resolvers/api.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/selfprivacy_api/resolvers/api.py b/selfprivacy_api/resolvers/api.py index f375dc8..871559e 100644 --- a/selfprivacy_api/resolvers/api.py +++ b/selfprivacy_api/resolvers/api.py @@ -22,7 +22,7 @@ def get_api_version() -> str: def get_devices() -> typing.List[ApiDevice]: """Get list of devices""" - caller_name = get_token_name(request.headers.get("Authorization").split(" ")[1]) + caller_name = get_token_name(request.headers.get("Authorization").split(" ")[1] if request.headers.get("Authorization") is not None else None) tokens = get_tokens_info() return [ ApiDevice( @@ -47,7 +47,7 @@ def get_recovery_key_status() -> ApiRecoveryKeyStatus: return ApiRecoveryKeyStatus( exists=True, valid=is_recovery_token_valid(), - creation_date=datetime.datetime.strptime(status["creation_date"], "%Y-%m-%dT%H:%M:%S.%fZ"), - expiration_date=datetime.datetime.strptime(status["expiration_date"], "%Y-%m-%dT%H:%M:%S.%fZ") if status["expiration_date"] is not None else None, + creation_date=datetime.datetime.strptime(status["date"], "%Y-%m-%dT%H:%M:%S.%fZ"), + expiration_date=datetime.datetime.strptime(status["expiration"], "%Y-%m-%dT%H:%M:%S.%fZ") if status["expiration"] is not None else None, uses_left=status["uses_left"] if status["uses_left"] is not None else None, )