Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
validator: Replace converter=int with json_validator=check_int.
Anders Kaseorgc3788ab84732
diff --git a/zerver/tests/test_decorators.py b/zerver/tests/test_decorators.pyindex 9491b9e6d87..17c03ed4c53 100644--- a/zerver/tests/test_decorators.py+++ b/zerver/tests/test_decorators.py@@ -130,7 +130,8 @@ class DecoratorTestCase(ZulipTestCase):def test_REQ_aliases(self) -> None:@has_request_variablesdef double(- request: HttpRequest, x: int = REQ(whence="number", aliases=["x", "n"], converter=int)+ request: HttpRequest,+ x: int = REQ(whence="number", aliases=["x", "n"], json_validator=check_int),) -> HttpResponse:return json_response(data={"number": x + x})diff --git a/zerver/tornado/views.py b/zerver/tornado/views.pyindex c800090bb4a..a17793fbf41 100644--- a/zerver/tornado/views.py+++ b/zerver/tornado/views.py@@ -67,7 +67,7 @@ def get_events_backend(user_client: Optional[Client] = REQ(converter=get_client, default=None, intentionally_undocumented=True),- last_event_id: Optional[int] = REQ(converter=int, default=None),+ last_event_id: Optional[int] = REQ(json_validator=check_int, default=None),queue_id: Optional[str] = REQ(default=None),# apply_markdown, client_gravatar, all_public_streams, and various# other parameters are only used when registering a new queue via thisdiff --git a/zerver/views/events_register.py b/zerver/views/events_register.pyindex 1851ae4b2bc..175f9718410 100644--- a/zerver/views/events_register.py+++ b/zerver/views/events_register.py@@ -7,7 +7,7 @@ from zerver.lib.events import do_events_registerfrom zerver.lib.exceptions import JsonableErrorfrom zerver.lib.request import REQ, RequestNotes, has_request_variablesfrom zerver.lib.response import json_success-from zerver.lib.validator import check_bool, check_dict, check_list, check_string+from zerver.lib.validator import check_bool, check_dict, check_int, check_list, check_stringfrom zerver.models import Stream, UserProfile@@ -69,7 +69,7 @@ def events_register_backend(narrow: NarrowT = REQ(json_validator=check_list(check_list(check_string, length=2)), default=[]),- queue_lifespan_secs: int = REQ(converter=int, default=0, documentation_pending=True),+ queue_lifespan_secs: int = REQ(json_validator=check_int, default=0, documentation_pending=True),) -> HttpResponse:if all_public_streams and not user_profile.can_access_public_streams():raise JsonableError(_("User not authorized for this query"))