@task(name='geonode.tasks.deletion.delete_layer', queue='cleanup')
def delete_layer(object_id):
 try:
  layer = Layer.objects.get(id=object_id)
 except Layer.DoesNotExist:
  return
 layer.delete()

@ task ( name = 'geonode.tasks.deletion.delete_layer' , queue = 'cleanup' ) def delete_layer ( object_id ) : try : layer = Layer . objects . get ( id = object_id ) except Layer . DoesNotExist : return layer . delete ( )
deletes a layer .