diff options
| -rw-r--r-- | ishtar_common/models.py | 4 | 
1 files changed, 4 insertions, 0 deletions
| diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 893c3b481..fb6bebed7 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -294,6 +294,7 @@ class ImageModel(models.Model):          if self.has_changed('image'):              # convert to jpg              filename = os.path.splitext(os.path.split(self.image.name)[-1])[0] +            old_path = self.image.path              filename = "%s.jpg" % filename              image = Image.open(self.image.file) @@ -306,6 +307,9 @@ class ImageModel(models.Model):                              self.create_thumb(image, self.IMAGE_MAX_SIZE),                              save=False) +            if old_path != self.image.path: +                os.remove(old_path) +              # save the thumbnail              self.thumbnail.save('_%s' % filename,                               self.create_thumb(image, self.THUMB_MAX_SIZE), | 
