@task(name='geonode.tasks.update.create_document_thumbnail', queue='update')
def create_document_thumbnail(object_id):
 try:
  document = Document.objects.get(id=object_id)
 except Document.DoesNotExist:
  return
 image = document._render_thumbnail()
 filename = ('document-%s-thumb.png' % document.uuid)
 document.save_thumbnail(filename, image)

@ task ( name = 'geonode.tasks.update.create_document_thumbnail' , queue = 'update' ) def create_document_thumbnail ( object_id ) : try : document = Document . objects . get ( id = object_id ) except Document . DoesNotExist : return image = document . _render_thumbnail ( ) filename = ( 'document-%s-thumb.png' % document . uuid ) document . save_thumbnail ( filename , image )
runs the create_thumbnail logic on a document .