From b36aab33bbfa8318076d0917bb7be6388294cc74 Mon Sep 17 00:00:00 2001 From: gilesb Date: Mon, 12 Jan 2026 19:02:16 +0000 Subject: [PATCH] Fix clear-data to check recipe delete return value The delete_recipe() returns (success, error) tuple but clear-data wasn't checking the result, so failed deletes weren't being reported. Co-Authored-By: Claude Opus 4.5 --- app/routers/home.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/routers/home.py b/app/routers/home.py index d245734..7a62d0f 100644 --- a/app/routers/home.py +++ b/app/routers/home.py @@ -122,8 +122,11 @@ async def clear_user_data(request: Request): recipes = await recipe_service.list_recipes(actor_id, offset=0, limit=10000) for recipe in recipes: try: - await recipe_service.delete_recipe(recipe["recipe_id"], actor_id) - deleted["recipes"] += 1 + success, error = await recipe_service.delete_recipe(recipe["recipe_id"], actor_id) + if success: + deleted["recipes"] += 1 + else: + errors.append(f"Recipe {recipe['recipe_id']}: {error}") except Exception as e: errors.append(f"Recipe {recipe['recipe_id']}: {e}") except Exception as e: