Skip to content

Commit

Permalink
Linter errors fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
afechler committed Feb 23, 2024
1 parent 53a777a commit 01af9ab
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions synapse/rest/admin/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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")


Expand Down

0 comments on commit 01af9ab

Please sign in to comment.