From 868c48ccb9fce44c85fe1db453b8c05bdd7b44ef Mon Sep 17 00:00:00 2001 From: machka-pasla Date: Thu, 4 Sep 2025 19:00:03 +0300 Subject: [PATCH] Remove outdated comments and fallback logic in payment method history handler - Eliminated unnecessary comments regarding auto-renewal payment methods to enhance code clarity. - Removed fallback logic for including auto-renew entries, streamlining the filtering process for user payments. --- bot/handlers/user/subscription.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/bot/handlers/user/subscription.py b/bot/handlers/user/subscription.py index e560567..c7c6856 100644 --- a/bot/handlers/user/subscription.py +++ b/bot/handlers/user/subscription.py @@ -942,7 +942,6 @@ async def payment_method_history(callback: types.CallbackQuery, settings: Settin # Filter to rows we can confidently associate with the selected method # Heuristics: # 1) Payments with yookassa_payment_id -> fetch payment info and compare payment_method.id - # 2) For auto-renew description, it always uses default saved method; keep those too filtered: List[Payment] = [] for p in user_payments: if p.provider != 'yookassa': @@ -956,9 +955,6 @@ async def payment_method_history(callback: types.CallbackQuery, settings: Settin continue except Exception: pass - # Fallback: auto-renew entries initiated via default method; include them - if (p.description or "").lower().startswith("auto-renewal"): - filtered.append(p) user_payments = filtered if not user_payments: # Try to get pm_id from context to go one step back