From 07101afe152cb024a4e4312beea018acd09347aa Mon Sep 17 00:00:00 2001 From: 9qeklajc <9qeklajc> Date: Fri, 25 Jul 2025 13:57:26 +0200 Subject: [PATCH] fix lint --- router/payment/x_cashu.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/router/payment/x_cashu.py b/router/payment/x_cashu.py index d6901a35..010c64bc 100644 --- a/router/payment/x_cashu.py +++ b/router/payment/x_cashu.py @@ -57,7 +57,7 @@ async def forward_to_upstream( if response.status_code != 200: refund_token = await send_refund(amount, unit) - response = Response( + error_response = Response( content=json.dumps( { "error": { @@ -71,8 +71,9 @@ async def forward_to_upstream( status_code=response.status_code, media_type="application/json", ) - response.headers["X-Cashu"] = refund_token - return response + error_response.headers["X-Cashu"] = refund_token + return error_response + if path.endswith("chat/completions"): result = await handle_x_cashu_chat_completion(response, amount, unit) background_tasks = BackgroundTasks()