Allowed for null products, move ingredient spreading server-side #1
1 changed files with 1 additions and 1 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue