From 78317fb5d40fef63909a4815cf2ab72534936eb0 Mon Sep 17 00:00:00 2001 From: jableader Date: Mon, 28 Jul 2025 21:50:49 +1000 Subject: [PATCH] Fixed person/meal saving in shopping --- shopping/db.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shopping/db.py b/shopping/db.py index 6f2f877..b1d9ec2 100644 --- a/shopping/db.py +++ b/shopping/db.py @@ -105,7 +105,7 @@ async def purchase(conn, shopping_list: ShoppingList) -> None: if item.ingredient_id is None or item.ingredient_id < 0: raise ValueError('Ingredient request must have a valid ingredient id') - isMeal = item.meal_id is None or item.meal_id < 0 + isMeal = item.meal_id is not None and item.meal_id >= 0 isPersonRequest = (not isMeal) and item.person_id is not None and item.person_id >= 0 if not isMeal and not isPersonRequest: