summary refs log tree commit diff
path: root/synapse/rest/admin/federation.py
diff options
context:
space:
mode:
authorDenis Kasak <dkasak@termina.org.uk>2024-06-24 15:12:14 +0200
committerGitHub <noreply@github.com>2024-06-24 15:12:14 +0200
commit700d2cc4a0d457642edb43bc3714d212f15d797f (patch)
treefc338a7d0cd2649b3dba0992e9e8c59e2ac1c349 /synapse/rest/admin/federation.py
parentBump lazy_static from 1.4.0 to 1.5.0 (#17355) (diff)
downloadsynapse-700d2cc4a0d457642edb43bc3714d212f15d797f.tar.xz
Tidy up integer parsing (#17339)
The parse_integer function was previously made to reject negative values by
default in https://github.com/element-hq/synapse/pull/16920, but the
documentation stated otherwise. This fixes the documentation and also:

- Removes explicit negative=False parameters from call sites.
- Brings the negative default of parse_integer_from_args in alignment with
  parse_integer.
Diffstat (limited to 'synapse/rest/admin/federation.py')
-rw-r--r--synapse/rest/admin/federation.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/synapse/rest/admin/federation.py b/synapse/rest/admin/federation.py

index 14ab4644cb..d85a04b825 100644 --- a/synapse/rest/admin/federation.py +++ b/synapse/rest/admin/federation.py
@@ -61,8 +61,8 @@ class ListDestinationsRestServlet(RestServlet): async def on_GET(self, request: SynapseRequest) -> Tuple[int, JsonDict]: await assert_requester_is_admin(self._auth, request) - start = parse_integer(request, "from", default=0, negative=False) - limit = parse_integer(request, "limit", default=100, negative=False) + start = parse_integer(request, "from", default=0) + limit = parse_integer(request, "limit", default=100) destination = parse_string(request, "destination") @@ -181,8 +181,8 @@ class DestinationMembershipRestServlet(RestServlet): if not await self._store.is_destination_known(destination): raise NotFoundError("Unknown destination") - start = parse_integer(request, "from", default=0, negative=False) - limit = parse_integer(request, "limit", default=100, negative=False) + start = parse_integer(request, "from", default=0) + limit = parse_integer(request, "limit", default=100) direction = parse_enum(request, "dir", Direction, default=Direction.FORWARDS)