clear icon cache

This commit is contained in:
j 2011-08-10 19:00:49 +02:00
parent 0df8d78ccf
commit ce665636fa

View file

@ -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):