mirror of
				https://github.com/zulip/zulip.git
				synced 2025-10-30 19:43:47 +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
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							93d2ae8092
						
					
				
				
					commit
					f0e655f1d8
				
			| @@ -102,7 +102,7 @@ def create_realm_custom_profile_field( | ||||
|     name: str = REQ(default="", converter=lambda x: x.strip()), | ||||
|     hint: str = REQ(default=""), | ||||
|     field_data: ProfileFieldData = REQ(default={}, converter=orjson.loads), | ||||
|     field_type: int = REQ(validator=check_int), | ||||
|     field_type: int = REQ(json_validator=check_int), | ||||
| ) -> HttpResponse: | ||||
|     validate_custom_profile_field(name, hint, field_type, field_data) | ||||
|     try: | ||||
| @@ -173,7 +173,7 @@ def update_realm_custom_profile_field( | ||||
| def reorder_realm_custom_profile_fields( | ||||
|     request: HttpRequest, | ||||
|     user_profile: UserProfile, | ||||
|     order: List[int] = REQ(validator=check_list(check_int)), | ||||
|     order: List[int] = REQ(json_validator=check_list(check_int)), | ||||
| ) -> HttpResponse: | ||||
|     try_reorder_realm_custom_profile_fields(user_profile.realm, order) | ||||
|     return json_success() | ||||
| @@ -184,7 +184,7 @@ def reorder_realm_custom_profile_fields( | ||||
| def remove_user_custom_profile_data( | ||||
|     request: HttpRequest, | ||||
|     user_profile: UserProfile, | ||||
|     data: List[int] = REQ(validator=check_list(check_int)), | ||||
|     data: List[int] = REQ(json_validator=check_list(check_int)), | ||||
| ) -> HttpResponse: | ||||
|     for field_id in data: | ||||
|         check_remove_custom_profile_field_value(user_profile, field_id) | ||||
| @@ -197,7 +197,7 @@ def update_user_custom_profile_data( | ||||
|     request: HttpRequest, | ||||
|     user_profile: UserProfile, | ||||
|     data: List[Dict[str, Union[int, str, List[int]]]] = REQ( | ||||
|         validator=check_list( | ||||
|         json_validator=check_list( | ||||
|             check_dict_only( | ||||
|                 [ | ||||
|                     ("id", check_int), | ||||
|   | ||||
		Reference in New Issue
	
	Block a user