mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-12-24 03:05:12 -05:00
fix: Brute parser fails if unit or food is empty (#6500)
This commit is contained in:
@@ -173,4 +173,10 @@ class ABCIngredientParser(ABC):
|
||||
ingredient.ingredient.food = food_match
|
||||
ingredient.ingredient.unit = None
|
||||
|
||||
# Make sure empty foods/units are set to None
|
||||
if ingredient.ingredient.food and not ingredient.ingredient.food.name:
|
||||
ingredient.ingredient.food = None
|
||||
if ingredient.ingredient.unit and not ingredient.ingredient.unit.name:
|
||||
ingredient.ingredient.unit = None
|
||||
|
||||
return ingredient
|
||||
|
||||
Reference in New Issue
Block a user