fix: Phase 0b - body_progress_score uses correct column name
Bug: Filtered goals by g.get('type_key') but goals table has 'goal_type' column.
Result: weight_goals was always empty → _score_weight_trend returned None.
Fix: Changed 'type_key' → 'goal_type' (matches goals table schema).
Verified: Migration 022 defines goal_type column, not type_key.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
202c36fad7
commit
6f20915d73
|
|
@ -386,7 +386,7 @@ def _score_weight_trend(profile_id: str) -> Optional[int]:
|
||||||
from goal_utils import get_active_goals
|
from goal_utils import get_active_goals
|
||||||
|
|
||||||
goals = get_active_goals(profile_id)
|
goals = get_active_goals(profile_id)
|
||||||
weight_goals = [g for g in goals if g.get('type_key') == 'weight']
|
weight_goals = [g for g in goals if g.get('goal_type') == 'weight']
|
||||||
if not weight_goals:
|
if not weight_goals:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user