diff --git a/synapse/rest/admin/users.py b/synapse/rest/admin/users.py index 3ecacc566d0..013ab884a4d 100644 --- a/synapse/rest/admin/users.py +++ b/synapse/rest/admin/users.py @@ -23,7 +23,7 @@ import logging import secrets from http import HTTPStatus -from typing import TYPE_CHECKING, Dict, List, Optional, Tuple +from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, Union import attr @@ -183,14 +183,18 @@ def _filter(a: attr.Attribute) -> bool: return HTTPStatus.OK, ret - def _parse_parameter_deactivated(self, request: SynapseRequest) -> bool | None: + def _parse_parameter_deactivated( + self, request: SynapseRequest + ) -> Union[bool, None]: return None if parse_boolean(request, "deactivated") else False class UsersRestServletV3(UsersRestServletV2): PATTERNS = admin_patterns("/users$", "v3") - def _parse_parameter_deactivated(self, request: SynapseRequest) -> bool | None: + def _parse_parameter_deactivated( + self, request: SynapseRequest + ) -> Union[bool, None]: return parse_boolean(request, "deactivated")