Skip to content

Commit

Permalink
Since filer no longer overwrites files with the same name (see FILE_O…
Browse files Browse the repository at this point in the history
…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
kux committed Dec 26, 2012
1 parent 88efa64 commit 0fba849
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions filertags/signals.py
Expand Up @@ -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
Expand Down

0 comments on commit 0fba849

Please sign in to comment.