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

Commit

Permalink
Actually fix typechecking with latest types-jsonschema (#13724)
Browse files Browse the repository at this point in the history
  • Loading branch information
David Robertson authored Sep 6, 2022
1 parent b5effc7 commit a4ecb8e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions changelog.d/13724.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix typechecking with latest types-jsonschema.
8 changes: 4 additions & 4 deletions synapse/api/filtering.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,13 @@


@FormatChecker.cls_checks("matrix_room_id")
def matrix_room_id_validator(room_id_str: str) -> bool:
return RoomID.is_valid(room_id_str)
def matrix_room_id_validator(room_id: object) -> bool:
return isinstance(room_id, str) and RoomID.is_valid(room_id)


@FormatChecker.cls_checks("matrix_user_id")
def matrix_user_id_validator(user_id_str: str) -> bool:
return UserID.is_valid(user_id_str)
def matrix_user_id_validator(user_id: object) -> bool:
return isinstance(user_id, str) and UserID.is_valid(user_id)


class Filtering:
Expand Down

0 comments on commit a4ecb8e

Please sign in to comment.