Fix error display: show TNS response separately, default filter contrato=011

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-06-26 19:25:33 -05:00
co-authored by Claude Sonnet 4.6
parent da99a446f1
commit e477aa2bea
2 changed files with 23 additions and 9 deletions
+9 -3
View File
@@ -234,13 +234,18 @@ async def test_enviar(request: Request, user: dict = Depends(get_current_user)):
examenes = [r.get("COD_EXAMEN", "") for r in grupo_rows]
try:
r = await client.post(endpoint_rda, json=rda_json, headers=headers)
raw_resp = r.text
try:
data = r.json()
ok_rda = (data.get("status") or (data.get("data") or {}).get("success", False)) if isinstance(data, dict) else False
msg_rda = ((data.get("data") or {}).get("response") or data.get("message") or r.text[:200])
ok_rda = bool(data.get("status") or (data.get("data") or {}).get("success", False)) if isinstance(data, dict) else False
msg_rda = (
((data.get("data") or {}).get("response"))
or data.get("message")
or raw_resp[:300]
)
except Exception:
ok_rda = r.status_code < 300
msg_rda = r.text[:200]
msg_rda = raw_resp[:300]
pasos.append({
"tipo": "rda",
"idrecepcion": id_rec,
@@ -251,6 +256,7 @@ async def test_enviar(request: Request, user: dict = Depends(get_current_user)):
"status": r.status_code,
"ok": ok_rda,
"mensaje": msg_rda,
"respuesta_tns": raw_resp,
"json_enviado": rda_json,
})
except Exception as ex: