keep up with folder auth api changes.
This commit is contained in:
parent
1a0a26d7b3
commit
593caa82ec
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user