diff --git a/nombres/historico/handler.py b/nombres/historico/handler.py index 890c0bf..4f2b1be 100644 --- a/nombres/historico/handler.py +++ b/nombres/historico/handler.py @@ -25,17 +25,19 @@ def handle(req): """handle a request to the function Args: req (str): request body - - { - p: prefijo del nombre, - g: genero del nombre, - a: año de nacimiento - } + + [nombre1, nombre2, ... nombreN] """ + nombres = [] try: - nombres = [remove_accents(req.strip().lower()) for x in req.split(",")] + nombres = loads(req) + nombres = [remove_accents(x.strip().lower()) for x in nombres] + nombres = [n for n in nombres if n] except Exception: + pass + + if not nombres: nombres = ["maria", "juan"] chart = pygal.Line(