mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-14 22:13:52 +01:00
Actually fix typechecking with latest types-jsonschema (#13724)
This commit is contained in:
parent
b5effc7201
commit
a4ecb8e353
2 changed files with 5 additions and 4 deletions
1
changelog.d/13724.misc
Normal file
1
changelog.d/13724.misc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Fix typechecking with latest types-jsonschema.
|
|
@ -140,13 +140,13 @@ USER_FILTER_SCHEMA = {
|
||||||
|
|
||||||
|
|
||||||
@FormatChecker.cls_checks("matrix_room_id")
|
@FormatChecker.cls_checks("matrix_room_id")
|
||||||
def matrix_room_id_validator(room_id_str: str) -> bool:
|
def matrix_room_id_validator(room_id: object) -> bool:
|
||||||
return RoomID.is_valid(room_id_str)
|
return isinstance(room_id, str) and RoomID.is_valid(room_id)
|
||||||
|
|
||||||
|
|
||||||
@FormatChecker.cls_checks("matrix_user_id")
|
@FormatChecker.cls_checks("matrix_user_id")
|
||||||
def matrix_user_id_validator(user_id_str: str) -> bool:
|
def matrix_user_id_validator(user_id: object) -> bool:
|
||||||
return UserID.is_valid(user_id_str)
|
return isinstance(user_id, str) and UserID.is_valid(user_id)
|
||||||
|
|
||||||
|
|
||||||
class Filtering:
|
class Filtering:
|
||||||
|
|
Loading…
Reference in a new issue