mirror of
https://github.com/zulip/zulip.git
synced 2025-10-30 11:33:51 +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
@@ -96,7 +96,9 @@ def fetch_drafts(request: HttpRequest, user_profile: UserProfile) -> HttpRespons
|
||||
def create_drafts(
|
||||
request: HttpRequest,
|
||||
user_profile: UserProfile,
|
||||
draft_dicts: List[Dict[str, Any]] = REQ("drafts", validator=check_list(draft_dict_validator)),
|
||||
draft_dicts: List[Dict[str, Any]] = REQ(
|
||||
"drafts", json_validator=check_list(draft_dict_validator)
|
||||
),
|
||||
) -> HttpResponse:
|
||||
draft_objects = []
|
||||
for draft_dict in draft_dicts:
|
||||
@@ -121,7 +123,7 @@ def edit_draft(
|
||||
request: HttpRequest,
|
||||
user_profile: UserProfile,
|
||||
draft_id: int,
|
||||
draft_dict: Dict[str, Any] = REQ("draft", validator=draft_dict_validator),
|
||||
draft_dict: Dict[str, Any] = REQ("draft", json_validator=draft_dict_validator),
|
||||
) -> HttpResponse:
|
||||
try:
|
||||
draft_object = Draft.objects.get(id=draft_id, user_profile=user_profile)
|
||||
|
||||
Reference in New Issue
Block a user