diff --git a/pandora/item/models.py b/pandora/item/models.py index fe87ef30..0e918ec0 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -975,6 +975,10 @@ class Item(models.Model): p = subprocess.Popen(cmd) p.wait() self.save() + icons = os.path.abspath(os.path.join(settings.MEDIA_ROOT, icon)) + icons = glob(icons.replace('.jpg', '*.jpg')) + for f in filter(lambda p: not p.endswith('/icon.jpg'), icons): + os.unlink(f) return icon def delete_item(sender, **kwargs):