request: Remove redundant str_validator=check_string from REQ().

REQ(str_validator=check_string) is equivalent to the default behavior
of REQ().

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2021-04-07 12:53:14 -07:00 committed by Tim Abbott
parent 8f0f0b9e91
commit 93d2ae8092
2 changed files with 2 additions and 2 deletions

View File

@ -922,7 +922,7 @@ def parse_anchor_value(anchor_val: Optional[str], use_first_unread_anchor: bool)
def get_messages_backend(
request: HttpRequest,
maybe_user_profile: Union[UserProfile, AnonymousUser],
anchor_val: Optional[str] = REQ("anchor", str_validator=check_string, default=None),
anchor_val: Optional[str] = REQ("anchor", default=None),
num_before: int = REQ(converter=to_non_negative_int),
num_after: int = REQ(converter=to_non_negative_int),
narrow: OptionalNarrowListT = REQ("narrow", converter=narrow_parameter, default=None),

View File

@ -68,7 +68,7 @@ def register_remote_server(
str_validator=check_string_fixed_length(RemoteZulipServer.API_KEY_LENGTH)
),
hostname: str = REQ(str_validator=check_capped_string(RemoteZulipServer.HOSTNAME_MAX_LENGTH)),
contact_email: str = REQ(str_validator=check_string),
contact_email: str = REQ(),
new_org_key: Optional[str] = REQ(
str_validator=check_string_fixed_length(RemoteZulipServer.API_KEY_LENGTH), default=None
),