Fix typechecking with latest `types-jsonschema` (#13712)

1.103.0-whithout-watcha
David Robertson 2 years ago committed by GitHub
parent 898fef2789
commit 8cb9261598
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      changelog.d/13712.misc
  2. 8
      synapse/api/filtering.py

@ -0,0 +1 @@
Fix typechecking with latest types-jsonschema.

@ -140,13 +140,13 @@ USER_FILTER_SCHEMA = {
@FormatChecker.cls_checks("matrix_room_id")
def matrix_room_id_validator(room_id_str: str) -> RoomID:
return RoomID.from_string(room_id_str)
def matrix_room_id_validator(room_id_str: str) -> bool:
return RoomID.is_valid(room_id_str)
@FormatChecker.cls_checks("matrix_user_id")
def matrix_user_id_validator(user_id_str: str) -> UserID:
return UserID.from_string(user_id_str)
def matrix_user_id_validator(user_id_str: str) -> bool:
return UserID.is_valid(user_id_str)
class Filtering:

Loading…
Cancel
Save