@task(name='geonode.tasks.deletion.delete_map', queue='cleanup', expires=300)
def delete_map(object_id):
 try:
  map_obj = Map.objects.get(id=object_id)
 except Map.DoesNotExist:
  return
 map_obj.layer_set.all().delete()
 map_obj.delete()

@ task ( name = 'geonode.tasks.deletion.delete_map' , queue = 'cleanup' , expires = 300 ) def delete_map ( object_id ) : try : map_obj = Map . objects . get ( id = object_id ) except Map . DoesNotExist : return map_obj . layer_set . all ( ) . delete ( ) map_obj . delete ( )
deletes a map and the associated map layers .