fix: test-email actually sends; vote page pre-checks existing votes; lowercase MealPlanItemStatus everywhere

- /api/admin/test-email now calls get_email_backend().send() instead of only logging.
- /api/meals/vote/{id} GET now queries MealPlanVote and renders 'already voted' confirmation if found.
- api/meals.py: fix remaining uppercase MealPlanItemStatus enum ref (DENIED, APPROVED, PENDING).
- Fixes the 'all meals show as pending' status regression and the 'Error: Already voted' bug.
This commit is contained in:
2026-05-14 12:17:44 -07:00
parent 26d9985433
commit 6323eadc86
6 changed files with 77 additions and 27 deletions
+1 -1
View File
@@ -182,7 +182,7 @@ def generate_meal_plan(
recipe_id=scored_recipe.recipe_id,
day_of_week=index + 1, # Mon=1, Tue=2, Wed=3 by default
meal_type=MealType.DINNER,
approval_status=MealPlanItemStatus.PENDING,
approval_status=MealPlanItemStatus.pending,
estimated_cost=scored_recipe.cost.total_cost,
)
db.add(item)