Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

REQ: Check value in update_user_custom_profile_data.

Steve Howell92a552d2ad92
diff --git a/zerver/views/custom_profile_fields.py b/zerver/views/custom_profile_fields.py
index a200f548a97..6d2143afeaa 100644
--- a/zerver/views/custom_profile_fields.py
+++ b/zerver/views/custom_profile_fields.py
@@ -24,7 +24,7 @@ from zerver.lib.types import ProfileFieldData
from zerver.lib.users import validate_user_custom_profile_data
from zerver.lib.validator import (
check_capped_string,
- check_dict,
+ check_dict_only,
check_int,
check_list,
check_string,
@@ -180,10 +180,10 @@ def update_user_custom_profile_data(
user_profile: UserProfile,
data: List[Dict[str, Union[int, str, List[int]]]] = REQ(
validator=check_list(
- check_dict(
- [('id', check_int)],
- value_validator=check_union([check_int, check_string, check_list(check_int)]),
- ),
+ check_dict_only([
+ ('id', check_int),
+ ('value', check_union([check_int, check_string, check_list(check_int)])),
+ ]),
)
),
) -> HttpResponse: