fix: Phase 0b - body_progress_score uses correct column name
All checks were successful
Deploy Development / deploy (push) Successful in 46s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 13s

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:
Lars 2026-03-28 11:16:29 +01:00
parent 202c36fad7
commit 6f20915d73

View File

@ -386,7 +386,7 @@ def _score_weight_trend(profile_id: str) -> Optional[int]:
from goal_utils import get_active_goals
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:
return None