From 41ffffca33b22c8422abf849abc0a265e2f9f0bd Mon Sep 17 00:00:00 2001 From: Valder Date: Mon, 2 Jun 2014 10:21:37 -0300 Subject: [PATCH] bugfix windows need close file before delete --- compress_storage/base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compress_storage/base.py b/compress_storage/base.py index 8d40534..cbeaa40 100644 --- a/compress_storage/base.py +++ b/compress_storage/base.py @@ -12,7 +12,7 @@ class CompressFieldFile(FieldFile): - compress_ext = None + compress_ext = None def _is_compressed(self): basename, ext = os.path.splitext(self.name) @@ -39,6 +39,7 @@ def _update_filefield_name(self, delete_old_file=True): self.instance.save() if delete_old_file: + self.file.close() self.storage.delete(old_name) def compress(self, async=True, delete_old_file=FILE_COMPRESS_DELETE_OLD_FILE):