Просмотр исходного кода

fix: validation for upload methods of non-image files within the work… (#15932)

tags/1.1.0
Arcaner 7 месяцев назад
Родитель
Сommit
e6a8800f66
Аккаунт пользователя с таким Email не найден
1 измененных файлов: 8 добавлений и 2 удалений
  1. 8
    2
      api/factories/file_factory.py

+ 8
- 2
api/factories/file_factory.py Просмотреть файл

@@ -289,9 +289,15 @@ def _is_file_valid_with_config(
):
return False

if input_file_type == FileType.IMAGE and config.image_config:
if config.image_config.transfer_methods and file_transfer_method not in config.image_config.transfer_methods:
if input_file_type == FileType.IMAGE:
if (
config.image_config
and config.image_config.transfer_methods
and file_transfer_method not in config.image_config.transfer_methods
):
return False
elif config.allowed_file_upload_methods and file_transfer_method not in config.allowed_file_upload_methods:
return False

return True


Загрузка…
Отмена
Сохранить