diff --git a/app/routes/test_rda.py b/app/routes/test_rda.py index 8e186ef..4b0dd26 100644 --- a/app/routes/test_rda.py +++ b/app/routes/test_rda.py @@ -77,10 +77,9 @@ async def get_candidatos(request: Request, user: dict = Depends(get_current_user cfg = {r[0]: r[1] for r in db.execute("SELECT key, value FROM config").fetchall()} db.close() - fb = get_firebird_from_config(cfg) - ok, err = fb.connect() - if not ok: - return JSONResponse({"error": f"Error Firebird: {err}"}) + fb, fb_ok, fb_msg = get_firebird_from_config(cfg) + if not fb_ok: + return JSONResponse({"error": f"Error Firebird: {fb_msg}"}) sql = _SQL_CANDIDATOS params = {} @@ -146,10 +145,9 @@ async def test_enviar(request: Request, user: dict = Depends(get_current_user)): prefijo_def = cfg.get("prefijo_tns_default", "00") api_sucursal = cfg.get("api_sucursal", "00") or "00" - fb = get_firebird_from_config(cfg) - ok, err = fb.connect() - if not ok: - return JSONResponse({"error": f"Error Firebird: {err}"}) + fb, fb_ok, fb_msg = get_firebird_from_config(cfg) + if not fb_ok: + return JSONResponse({"error": f"Error Firebird: {fb_msg}"}) if modo == "factura": where = "r.NUM_FACTURA = :val"