def delete_preview_files(sender, instance, **kw):
 for filename in [instance.image_path, instance.thumbnail_path]:
  if storage.exists(filename):
   log.info(('Removing filename: %s for preview: %s' % (filename, instance.pk)))
   storage.delete(filename)

def delete_preview_files ( sender , instance , ** kw ) : for filename in [ instance . image_path , instance . thumbnail_path ] : if storage . exists ( filename ) : log . info ( ( 'Removing filename: %s for preview: %s' % ( filename , instance . pk ) ) ) storage . delete ( filename )
on delete of the preview object from the database .