소스 검색

fix: Validate file only when file type is set to custom (#11036)

Signed-off-by: -LAN- <laipz8200@outlook.com>
-LAN- 5 달 전
부모
커밋
04f1e18342
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      api/factories/file_factory.py

+ 5 - 1
api/factories/file_factory.py

@@ -241,7 +241,11 @@ def _is_file_valid_with_config(
     ):
         return False
 
-    if config.allowed_file_extensions and file_extension not in config.allowed_file_extensions:
+    if (
+        input_file_type == FileType.CUSTOM
+        and config.allowed_file_extensions is not None
+        and file_extension not in config.allowed_file_extensions
+    ):
         return False
 
     if config.allowed_file_upload_methods and file_transfer_method not in config.allowed_file_upload_methods: