Commit fd424bc4 authored by fred's avatar fred
Browse files

do not try cleaning thumbnails fro objects without images

parent a799e871
......@@ -60,6 +60,8 @@ register.filter(thumbnail)
def clean_thumb(sender, instance, **kwargs):
if not hasattr(instance, 'image'):
if not instance.image:
name, ext = os.path.splitext(os.path.basename(
exp = '^%s__\d+x\d+x[0-1]{1}\%s' % (name, ext)
for file_path in os.listdir(settings.MEDIA_ROOT):
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment