From 818de5dda81a310b903d96c3f753b4ea46c4f80b Mon Sep 17 00:00:00 2001 From: -LAN- Date: Mon, 21 Oct 2024 20:37:48 +0800 Subject: [PATCH] fix(file upload): correct upload method key for image config - Use a fallback key for allowed upload methods in the image configuration. - Ensure proper retrieval of transfer methods from the configuration. --- api/core/app/app_config/features/file_upload/manager.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/core/app/app_config/features/file_upload/manager.py b/api/core/app/app_config/features/file_upload/manager.py index 12037f85708e7..42beec2535483 100644 --- a/api/core/app/app_config/features/file_upload/manager.py +++ b/api/core/app/app_config/features/file_upload/manager.py @@ -17,10 +17,13 @@ def convert(cls, config: Mapping[str, Any], is_vision: bool = True): file_upload_dict = config.get("file_upload") if file_upload_dict: if file_upload_dict.get("enabled"): + transform_methods = file_upload_dict.get("allowed_file_upload_methods") or file_upload_dict.get( + "allowed_upload_methods", [] + ) data = { "image_config": { "number_limits": file_upload_dict["number_limits"], - "transfer_methods": file_upload_dict["allowed_upload_methods"], + "transfer_methods": transform_methods, } }