diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2022-10-30 01:54:07 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2022-10-30 01:54:07 +0300 |
commit | ae2bfdcd68f312c47f9699917ccb13302f401ba7 (patch) | |
tree | 005c8c805a459e876c0504d7026f5b6f980b34bb /src/home | |
parent | 2518bf0e8457d8d945f40cc6ff1a74fc094d6999 (diff) |
fix web api client again
Diffstat (limited to 'src/home')
-rw-r--r-- | src/home/api/web_api_client.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/home/api/web_api_client.py b/src/home/api/web_api_client.py index 6f8ff27..4a9f4bc 100644 --- a/src/home/api/web_api_client.py +++ b/src/home/api/web_api_client.py @@ -168,13 +168,13 @@ class WebAPIClient: raise ApiResponseError(r.status_code, 'TypeError', 'content-type is not application/json') data = json.loads(r.text) - if r.status_code != 200 or data['result'] == 'error': + if r.status_code != 200: raise ApiResponseError(r.status_code, data['error']['type'], data['error']['message'], data['error']['stacktrace'] if 'stacktrace' in data['error'] else None) - return data['data'] if 'data' in data else True + return data['response'] if 'response' in data else True finally: for fname, f in fd.items(): # logger.debug(f'closing file {fname} (fd={f})') |