From 510fff3059fd19dd58338aa62995bea2a0f1e32a Mon Sep 17 00:00:00 2001 From: Aroy-Art Date: Thu, 3 Apr 2025 12:32:23 +0200 Subject: [PATCH] Fix: check if file is not empty and try importing it --- backend/apps/archive/management/commands/import_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/apps/archive/management/commands/import_data.py b/backend/apps/archive/management/commands/import_data.py index b4da2b4..8e75f1e 100644 --- a/backend/apps/archive/management/commands/import_data.py +++ b/backend/apps/archive/management/commands/import_data.py @@ -117,7 +117,7 @@ class BaseImporter(ABC): hash_blake3=file_hash ) - if created: + if created or not file_instance.file: with open(file_path, "rb") as file: file_instance.file.save(hash_file_name, file)