From 5005b57dbdd350ff2ad5bb5486afb6bbb65cca14 Mon Sep 17 00:00:00 2001 From: Sabiha Khan Date: Tue, 12 May 2026 13:56:01 +0530 Subject: [PATCH] fix: prior pre-pr drift check failures --- api/services/telephony/providers/telnyx/routes.py | 4 +--- api/services/telephony/providers/telnyx/strategies.py | 8 ++++---- api/services/workflow/audit.py | 4 +++- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/api/services/telephony/providers/telnyx/routes.py b/api/services/telephony/providers/telnyx/routes.py index f84300c..455e0e8 100644 --- a/api/services/telephony/providers/telnyx/routes.py +++ b/api/services/telephony/providers/telnyx/routes.py @@ -154,9 +154,7 @@ async def handle_telnyx_transfer_result(transfer_id: str, request: Request): # from the webhook payload. The strategy at pipeline-end then only has # to join the caller into this conference. Idempotent on duplicate # webhooks: if conference_id is already stamped on the context, skip. - conference_id = ( - transfer_context.conference_id if transfer_context else None - ) + conference_id = transfer_context.conference_id if transfer_context else None if transfer_context and not conference_id: conference_id = await _seed_destination_conference( transfer_context=transfer_context, diff --git a/api/services/telephony/providers/telnyx/strategies.py b/api/services/telephony/providers/telnyx/strategies.py index 15b9458..16464f3 100644 --- a/api/services/telephony/providers/telnyx/strategies.py +++ b/api/services/telephony/providers/telnyx/strategies.py @@ -74,7 +74,9 @@ class TelnyxConferenceStrategy(TransferStrategy): return joined except Exception as e: - logger.error(f"[Telnyx Transfer] Failed to join caller into conference: {e}") + logger.error( + f"[Telnyx Transfer] Failed to join caller into conference: {e}" + ) await self._cleanup_transfer_context(transfer_context.transfer_id) return False @@ -166,9 +168,7 @@ class TelnyxHangupStrategy(HangupStrategy): ) return False - endpoint = ( - f"{TELNYX_API_BASE}/calls/{call_control_id}/actions/hangup" - ) + endpoint = f"{TELNYX_API_BASE}/calls/{call_control_id}/actions/hangup" headers = { "Content-Type": "application/json", "Authorization": f"Bearer {api_key}", diff --git a/api/services/workflow/audit.py b/api/services/workflow/audit.py index 0265375..6a7dade 100644 --- a/api/services/workflow/audit.py +++ b/api/services/workflow/audit.py @@ -92,7 +92,9 @@ def audit_definition(nodes, edges) -> list[dict]: "source_type": src_type, "target_id": tgt, "target_type": tgt_type, - "edge_label": (e.get("data") or {}).get("label") if isinstance(e.get("data"), dict) else None, + "edge_label": (e.get("data") or {}).get("label") + if isinstance(e.get("data"), dict) + else None, "reason": r, } )