mirror of
				https://github.com/zulip/zulip.git
				synced 2025-10-31 03:53:50 +00:00 
			
		
		
		
	webhooks: Fix strange joining code in greenhous webhook.
This commit is contained in:
		| @@ -16,18 +16,17 @@ MESSAGE_TEMPLATE = """ | |||||||
|  |  | ||||||
|  |  | ||||||
| def dict_list_to_string(some_list: WildValue) -> str: | def dict_list_to_string(some_list: WildValue) -> str: | ||||||
|     internal_template = "" |     response_chunks = [] | ||||||
|     for item in some_list: |     for item in some_list: | ||||||
|         item_type = item.get("type", "").tame(check_string).title() |         item_type = item.get("type", "").tame(check_string).title() | ||||||
|         item_value = item.get("value").tame(check_none_or(check_string)) |         item_value = item.get("value").tame(check_none_or(check_string)) | ||||||
|         item_url = item.get("url").tame(check_none_or(check_url)) |         item_url = item.get("url").tame(check_none_or(check_url)) | ||||||
|         if item_type and item_value: |         if item_type and item_value: | ||||||
|             internal_template += f"{item_value} ({item_type}), " |             response_chunks.append(f"{item_value} ({item_type})") | ||||||
|         elif item_type and item_url: |         elif item_type and item_url: | ||||||
|             internal_template += f"[{item_type}]({item_url}), " |             response_chunks.append(f"[{item_type}]({item_url})") | ||||||
|  |  | ||||||
|     internal_template = internal_template.removesuffix(", ") |     return ", ".join(response_chunks) | ||||||
|     return internal_template |  | ||||||
|  |  | ||||||
|  |  | ||||||
| @webhook_view("Greenhouse") | @webhook_view("Greenhouse") | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user