diff options
Diffstat (limited to 'ishtar_common/models_imports.py')
-rw-r--r-- | ishtar_common/models_imports.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ishtar_common/models_imports.py b/ishtar_common/models_imports.py index 3ebbb8068..3270edf59 100644 --- a/ishtar_common/models_imports.py +++ b/ishtar_common/models_imports.py @@ -1907,11 +1907,13 @@ class ImportGroup(BaseImport): imports = [] imported_file, imported_images = None, None if self.imported_file: - imported_file = ContentFile(self.imported_file.read()) - imported_file.name = self.imported_file.name.split(os.sep)[-1] + with open(self.imported_file.path, "rb") as imp: + imported_file = ContentFile(imp.read()) + imported_file.name = self.imported_file.name.split(os.sep)[-1] if self.imported_images: - imported_images = ContentFile(self.imported_images.read()) - imported_images.name = self.imported_images.name.split(os.sep)[-1] + with open(self.imported_images.path, "rb") as imp: + imported_images = ContentFile(imp.read()) + imported_images.name = self.imported_images.name.split(os.sep)[-1] for import_type_relation in self.importer_type.importer_types.all(): importer_type = import_type_relation.importer_type |