Fixed type issue
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -163,4 +163,5 @@ cython_debug/
|
|||||||
storage/
|
storage/
|
||||||
|
|
||||||
# Custom
|
# Custom
|
||||||
ingredients.json
|
ingredients.json
|
||||||
|
checklist.md
|
||||||
@@ -37,7 +37,7 @@ def combine_ingredients(meals: dict) -> dict:
|
|||||||
for meal, ingredients in meals.items():
|
for meal, ingredients in meals.items():
|
||||||
for ingredient, detail in ingredients.items():
|
for ingredient, detail in ingredients.items():
|
||||||
if ingredient in combined_ingredients:
|
if ingredient in combined_ingredients:
|
||||||
combined_ingredients[ingredient]['quantity'] += detail['quantity']
|
combined_ingredients[ingredient]['quantity'] = str(float(combined_ingredients[ingredient]['quantity']) + float(detail['quantity']))
|
||||||
else:
|
else:
|
||||||
combined_ingredients[ingredient] = detail
|
combined_ingredients[ingredient] = detail
|
||||||
return combined_ingredients
|
return combined_ingredients
|
||||||
|
|||||||
Reference in New Issue
Block a user