From 01af9ab480f890c25a7f3cbbab23d909afe4c308 Mon Sep 17 00:00:00 2001 From: Alexander Fechler Date: Fri, 23 Feb 2024 15:49:24 +0100 Subject: [PATCH] Linter errors fixed. --- synapse/rest/admin/users.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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")