Commit b963dcac authored by Alex's avatar Alex
Browse files

Add dictionary serialisation methods for storing client in sessions

parent 8128fd78
......@@ -10,6 +10,13 @@ class Materials:
def __init__(self, token: str):
self._access_token = token
def get_as_dict(self) -> dict:
return vars(self)
def from_dict(client: dict):
return Materials(client["_access_token"])
def _is_alive() -> bool:
resp = requests.get(f"{MATERIALS_API_STATUS_URL}")
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment