mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	alert words: Make alert_words required for POST and DELETE.
Querying an endpoint with no information (thus a noop) and it producing a successful response doesn't seem to be expected. Given the case that the client makes such query with no content it will probably be unintentional and the API should let them know about it.
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							3ac49c1503
						
					
				
				
					commit
					3b21b17a35
				
			@@ -20,14 +20,14 @@ def clean_alert_words(alert_words: List[str]) -> List[str]:
 | 
			
		||||
 | 
			
		||||
@has_request_variables
 | 
			
		||||
def add_alert_words(request: HttpRequest, user_profile: UserProfile,
 | 
			
		||||
                    alert_words: List[str]=REQ(validator=check_list(check_string), default=[])
 | 
			
		||||
                    alert_words: List[str]=REQ(validator=check_list(check_string))
 | 
			
		||||
                    ) -> HttpResponse:
 | 
			
		||||
    do_add_alert_words(user_profile, clean_alert_words(alert_words))
 | 
			
		||||
    return json_success()
 | 
			
		||||
 | 
			
		||||
@has_request_variables
 | 
			
		||||
def remove_alert_words(request: HttpRequest, user_profile: UserProfile,
 | 
			
		||||
                       alert_words: List[str]=REQ(validator=check_list(check_string), default=[])
 | 
			
		||||
                       alert_words: List[str]=REQ(validator=check_list(check_string))
 | 
			
		||||
                       ) -> HttpResponse:
 | 
			
		||||
    do_remove_alert_words(user_profile, alert_words)
 | 
			
		||||
    return json_success()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user