mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 21:43:21 +00:00
request: Rename validator parameter of REQ to json_validator.
This makes it much more clear that this feature does JSON encoding, which previously was only indicated in the documentation. Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
93d2ae8092
commit
f0e655f1d8
@@ -19,7 +19,7 @@ from zerver.models import UserProfile
|
||||
def update_storage(
|
||||
request: HttpRequest,
|
||||
user_profile: UserProfile,
|
||||
storage: Dict[str, str] = REQ(validator=check_dict([], value_validator=check_string)),
|
||||
storage: Dict[str, str] = REQ(json_validator=check_dict([], value_validator=check_string)),
|
||||
) -> HttpResponse:
|
||||
try:
|
||||
set_bot_storage(user_profile, list(storage.items()))
|
||||
@@ -32,7 +32,7 @@ def update_storage(
|
||||
def get_storage(
|
||||
request: HttpRequest,
|
||||
user_profile: UserProfile,
|
||||
keys: Optional[List[str]] = REQ(validator=check_list(check_string), default=None),
|
||||
keys: Optional[List[str]] = REQ(json_validator=check_list(check_string), default=None),
|
||||
) -> HttpResponse:
|
||||
keys = keys or get_keys_in_bot_storage(user_profile)
|
||||
try:
|
||||
@@ -46,7 +46,7 @@ def get_storage(
|
||||
def remove_storage(
|
||||
request: HttpRequest,
|
||||
user_profile: UserProfile,
|
||||
keys: Optional[List[str]] = REQ(validator=check_list(check_string), default=None),
|
||||
keys: Optional[List[str]] = REQ(json_validator=check_list(check_string), default=None),
|
||||
) -> HttpResponse:
|
||||
keys = keys or get_keys_in_bot_storage(user_profile)
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user