diff --git a/mdrsclient/api/folder.py b/mdrsclient/api/folder.py index d8a8783..103c170 100644 --- a/mdrsclient/api/folder.py +++ b/mdrsclient/api/folder.py @@ -1,5 +1,6 @@ from typing import Final +import requests from pydantic import parse_obj_as from pydantic.dataclasses import dataclass @@ -75,11 +76,9 @@ class FolderApi(BaseApi): data = {"password": password} token_check(self.connection) response = self.connection.post(url, data=data) - # stupid! always returned status code 200 - self._raise_response_error(response) - data = response.json() - if data.get("status") is not True: + if response.status_code == requests.codes.unauthorized: raise UnauthorizedException("Password is incorrect.") + self._raise_response_error(response) return True def acl(self, id: str, access_level: int, recursive: bool, password: str | None) -> bool: