Skip to content

Commit

Permalink
bugfix windows need close file before delete
Browse files Browse the repository at this point in the history
  • Loading branch information
valdergallo committed Jun 2, 2014
1 parent de4ef04 commit 41ffffc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion compress_storage/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


class CompressFieldFile(FieldFile):
compress_ext = None
compress_ext = None

def _is_compressed(self):
basename, ext = os.path.splitext(self.name)
Expand All @@ -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):
Expand Down

0 comments on commit 41ffffc

Please sign in to comment.