diff --git a/src/trading/trading_plan.py b/src/trading/trading_plan.py index 9ffc30d..e917bf6 100644 --- a/src/trading/trading_plan.py +++ b/src/trading/trading_plan.py @@ -209,10 +209,12 @@ def get_trading_plan(plan_id: int) -> Optional[TradingPlan]: SELECT * FROM trading_plans WHERE id = %(id)s """, {'id': plan_id}) - if not result: + rows = result.result_rows + + if not rows: return None - plan = result[0] + plan = rows[0] return TradingPlan( id=plan[0], plan_name=plan[1], @@ -267,7 +269,7 @@ def get_all_trading_plans(status: Optional[PlanStatus] = None) -> List[TradingPl query += " ORDER BY updated_at DESC" results = client.query(query, params) - rows = results.result_rows # Ensure this is the correct method to access rows + rows = results.result_rows return [TradingPlan( id=row[0], plan_name=row[1],