diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6c4f60c3..a7926932 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -41,7 +41,7 @@ repos: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.6.7 + rev: v0.6.8 hooks: - id: ruff diff --git a/nc_py_api/_session.py b/nc_py_api/_session.py index 66326c7b..f3750160 100644 --- a/nc_py_api/_session.py +++ b/nc_py_api/_session.py @@ -301,7 +301,7 @@ def _response_event(self, response: Response) -> None: def download2fp(self, url_path: str, fp, dav: bool, params=None, **kwargs): adapter = self.adapter_dav if dav else self.adapter - with adapter.stream("GET", url_path, params=params, headers=kwargs.get("headers", None)) as response: + with adapter.stream("GET", url_path, params=params, headers=kwargs.get("headers")) as response: check_error(response) for data_chunk in response.iter_raw(chunk_size=kwargs.get("chunk_size", 5 * 1024 * 1024)): fp.write(data_chunk) @@ -425,7 +425,7 @@ async def _response_event(self, response: Response) -> None: async def download2fp(self, url_path: str, fp, dav: bool, params=None, **kwargs): adapter = self.adapter_dav if dav else self.adapter - async with adapter.stream("GET", url_path, params=params, headers=kwargs.get("headers", None)) as response: + async with adapter.stream("GET", url_path, params=params, headers=kwargs.get("headers")) as response: check_error(response) async for data_chunk in response.aiter_raw(chunk_size=kwargs.get("chunk_size", 5 * 1024 * 1024)): fp.write(data_chunk) diff --git a/nc_py_api/users.py b/nc_py_api/users.py index 581477e3..77e1fbfb 100644 --- a/nc_py_api/users.py +++ b/nc_py_api/users.py @@ -369,8 +369,8 @@ async def get_avatar( def _create(user_id: str, display_name: str | None, **kwargs) -> dict[str, typing.Any]: - password = kwargs.get("password", None) - email = kwargs.get("email", None) + password = kwargs.get("password") + email = kwargs.get("email") if not password and not email: raise ValueError("Either password or email must be set") data = {"userid": user_id}