🐛 fix(base.py): change condition to check if content is empty instead of None

The previous condition was checking if the content was None, but it should check if it is empty. This change fixes the error message to be more accurate.
This commit is contained in:
Gabriel Almeida 2023-05-27 23:39:05 -03:00
commit fa9a3a210b

View file

@ -120,7 +120,7 @@ def save_binary_file(content: str, file_name: str, accepted_types: list[str]) ->
# Get the destination folder
cache_path = Path(tempfile.gettempdir()) / PREFIX
if content is None:
if not content:
raise ValueError("Please, reload the file in the loader.")
data = content.split(",")[1]
decoded_bytes = base64.b64decode(data)