def restore_asset_from_trashcan(location):
 trash = contentstore('trashcan')
 store = contentstore()
 loc = StaticContent.get_location_from_path(location)
 content = trash.find(loc)
 store.save(content)
 if (content.thumbnail_location is not None):
  try:
   thumbnail_content = trash.find(content.thumbnail_location)
   store.save(thumbnail_content)
  except Exception:
   pass

def restore_asset_from_trashcan ( location ) : trash = contentstore ( 'trashcan' ) store = contentstore ( ) loc = StaticContent . get_location_from_path ( location ) content = trash . find ( loc ) store . save ( content ) if ( content . thumbnail_location is not None ) : try : thumbnail_content = trash . find ( content . thumbnail_location ) store . save ( thumbnail_content ) except Exception : pass
this method will restore an asset which got soft deleted and put back in the original course .