Public Access
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:
@@ -112,7 +112,7 @@ def pending_item(db, meal_plan):
|
||||
recipe_id=recipe.id,
|
||||
day_of_week=5,
|
||||
meal_type=MealType.DINNER,
|
||||
approval_status=MealPlanItemStatus.PENDING,
|
||||
approval_status=MealPlanItemStatus.pending,
|
||||
)
|
||||
db.add(item)
|
||||
db.flush()
|
||||
@@ -467,7 +467,7 @@ def test_step_deadline_resolves_pending_to_approved(db, weekly_run_emailed, meal
|
||||
db.flush()
|
||||
step_deadline(weekly_run_emailed, db)
|
||||
db.refresh(pending_item)
|
||||
assert pending_item.approval_status == MealPlanItemStatus.APPROVED
|
||||
assert pending_item.approval_status == MealPlanItemStatus.approved
|
||||
assert weekly_run_emailed.deadline_passed_at is not None
|
||||
|
||||
|
||||
@@ -478,7 +478,7 @@ def test_step_deadline_resolves_pending_to_denied(db, weekly_run_emailed, meal_p
|
||||
db.flush()
|
||||
step_deadline(weekly_run_emailed, db)
|
||||
db.refresh(pending_item)
|
||||
assert pending_item.approval_status == MealPlanItemStatus.DENIED
|
||||
assert pending_item.approval_status == MealPlanItemStatus.denied
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
@@ -520,7 +520,7 @@ def approved_item(db, meal_plan):
|
||||
recipe_id=recipe.id,
|
||||
day_of_week=6,
|
||||
meal_type=MealType.DINNER,
|
||||
approval_status=MealPlanItemStatus.APPROVED,
|
||||
approval_status=MealPlanItemStatus.approved,
|
||||
)
|
||||
db.add(item)
|
||||
db.flush()
|
||||
|
||||
Reference in New Issue
Block a user