Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Add type hints to additional servlet functions #10437

Merged
merged 7 commits into from
Jul 21, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/10437.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve servlet type hints.
13 changes: 2 additions & 11 deletions synapse/federation/transport/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ async def on_GET(
limit = parse_integer_from_args(query, "limit", 0)
since_token = parse_string_from_args(query, "since", None)
include_all_networks = parse_boolean_from_args(
query, "include_all_networks", False
query, "include_all_networks", default=False
)
third_party_instance_id = parse_string_from_args(
query, "third_party_instance_id", None
Expand Down Expand Up @@ -1908,16 +1908,7 @@ async def on_GET(
suggested_only = parse_boolean_from_args(query, "suggested_only", default=False)
max_rooms_per_space = parse_integer_from_args(query, "max_rooms_per_space")

exclude_rooms = []
if b"exclude_rooms" in query:
try:
exclude_rooms = [
room_id.decode("ascii") for room_id in query[b"exclude_rooms"]
]
except Exception:
raise SynapseError(
400, "Bad query parameter for exclude_rooms", Codes.INVALID_PARAM
)
exclude_rooms = parse_strings_from_args(query, "exclude_rooms", default=[])

return 200, await self.handler.federation_space_summary(
origin, room_id, suggested_only, max_rooms_per_space, exclude_rooms
Expand Down
Loading