clear icon cache

This commit is contained in:
j 2011-08-10 19:00:49 +02:00
parent a5467b4095
commit 7920c57e17

View file

@ -975,6 +975,10 @@ class Item(models.Model):
p = subprocess.Popen(cmd) p = subprocess.Popen(cmd)
p.wait() p.wait()
self.save() 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 return icon
def delete_item(sender, **kwargs): def delete_item(sender, **kwargs):