Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -r 5851127a6882 dc/stdimage/fields.py
- --- a/dc/stdimage/fields.py Tue May 26 14:36:55 2009 +0300
- +++ b/dc/stdimage/fields.py Wed May 27 17:44:15 2009 +0300
- @@ -90,7 +90,10 @@
- dst = self.generate_filename(instance, '%s_%s%s' % (self.name, instance._get_pk_val(), ext))
- dst_fullpath = os.path.join(settings.MEDIA_ROOT, dst)
- if os.path.abspath(filename) != os.path.abspath(dst_fullpath):
- - os.rename(filename, dst_fullpath)
- + if filename == os.path.join(settings.MEDIA_ROOT, self.default):
- + shutil.copyfile(filename, dst_fullpath)
- + else:
- + os.rename(filename, dst_fullpath)
- if self.size:
- self._resize_image(dst_fullpath, self.size)
- if self.thumbnail_size:
Add Comment
Please, Sign In to add comment