Skip to content

Commit 41ffffc

Browse files
committed
bugfix windows need close file before delete
1 parent de4ef04 commit 41ffffc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compress_storage/base.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313

1414
class CompressFieldFile(FieldFile):
15-
compress_ext = None
15+
compress_ext = None
1616

1717
def _is_compressed(self):
1818
basename, ext = os.path.splitext(self.name)
@@ -39,6 +39,7 @@ def _update_filefield_name(self, delete_old_file=True):
3939
self.instance.save()
4040

4141
if delete_old_file:
42+
self.file.close()
4243
self.storage.delete(old_name)
4344

4445
def compress(self, async=True, delete_old_file=FILE_COMPRESS_DELETE_OLD_FILE):

0 commit comments

Comments
 (0)