Fix get_firebird_from_config call in test_rda (returns tuple fb, ok, msg)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
c64a68ec6f
commit
c2977011ee
@@ -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()}
|
cfg = {r[0]: r[1] for r in db.execute("SELECT key, value FROM config").fetchall()}
|
||||||
db.close()
|
db.close()
|
||||||
|
|
||||||
fb = get_firebird_from_config(cfg)
|
fb, fb_ok, fb_msg = get_firebird_from_config(cfg)
|
||||||
ok, err = fb.connect()
|
if not fb_ok:
|
||||||
if not ok:
|
return JSONResponse({"error": f"Error Firebird: {fb_msg}"})
|
||||||
return JSONResponse({"error": f"Error Firebird: {err}"})
|
|
||||||
|
|
||||||
sql = _SQL_CANDIDATOS
|
sql = _SQL_CANDIDATOS
|
||||||
params = {}
|
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")
|
prefijo_def = cfg.get("prefijo_tns_default", "00")
|
||||||
api_sucursal = cfg.get("api_sucursal", "00") or "00"
|
api_sucursal = cfg.get("api_sucursal", "00") or "00"
|
||||||
|
|
||||||
fb = get_firebird_from_config(cfg)
|
fb, fb_ok, fb_msg = get_firebird_from_config(cfg)
|
||||||
ok, err = fb.connect()
|
if not fb_ok:
|
||||||
if not ok:
|
return JSONResponse({"error": f"Error Firebird: {fb_msg}"})
|
||||||
return JSONResponse({"error": f"Error Firebird: {err}"})
|
|
||||||
|
|
||||||
if modo == "factura":
|
if modo == "factura":
|
||||||
where = "r.NUM_FACTURA = :val"
|
where = "r.NUM_FACTURA = :val"
|
||||||
|
|||||||
Reference in New Issue
Block a user