Permalink
Browse files

Since filer no longer overwrites files with the same name (see FILE_O…

…VERWRITE setting in s3boto storage backend)

 => it makes more sense to delete the prev file before saving again, thus avoiding the generation of a new file.
  • Loading branch information...
1 parent 88efa64 commit 0fba849f71311cbf9b390dc0cb9da1a61feebb07 @kux kux committed Dec 26, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 filertags/signals.py
View
@@ -89,6 +89,7 @@ def _rewrite_file_content(filer_file, new_content):
storage = filer_file.file.storage
fp = ContentFile(new_content, filer_file.file.name)
filer_file.file.file = fp
+ storage.delete(filer_file.file.name)
filer_file.file.name = storage.save(filer_file.file.name, fp)
# all code in filer.filemodels.File.save which percedes the call to
# super(File, self).save will be executed BEFORE the resolve_resource_urls

0 comments on commit 0fba849

Please sign in to comment.