Fixed person/meal saving in shopping

This commit is contained in:
jableader 2025-07-28 21:50:49 +10:00
parent ba6a859ec7
commit 78317fb5d4

View file

@ -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: