feat: Remove "Is Food" and "Disable Amounts" Flags (#5684)

Co-authored-by: Kuchenpirat <24235032+Kuchenpirat@users.noreply.github.com>
This commit is contained in:
Michael Genson
2025-07-31 10:36:24 -05:00
committed by GitHub
parent efc0d31724
commit 245ca5fe3b
49 changed files with 173 additions and 364 deletions

View File

@@ -312,12 +312,10 @@ class ShoppingListService:
list_items: list[ShoppingListItemCreate] = []
for ingredient in recipe_ingredients:
if isinstance(ingredient.food, IngredientFood):
is_food = True
food_id = ingredient.food.id
label_id = ingredient.food.label_id
else:
is_food = False
food_id = None
label_id = None
@@ -329,7 +327,6 @@ class ShoppingListService:
new_item = ShoppingListItemCreate(
shopping_list_id=list_id,
is_food=is_food,
note=ingredient.note,
quantity=ingredient.quantity * scale if ingredient.quantity else 0,
food_id=food_id,

View File

@@ -177,7 +177,6 @@ class BaseMigrator(BaseService):
show_assets=self.household.preferences.recipe_show_assets,
landscape_view=self.household.preferences.recipe_landscape_view,
disable_comments=self.household.preferences.recipe_disable_comments,
disable_amount=self.household.preferences.recipe_disable_amount,
)
for recipe in validated_recipes:

View File

@@ -36,7 +36,6 @@ class BruteForceParser(ABCIngredientParser):
ingredient=RecipeIngredient(
unit=CreateIngredientUnit(name=bfi.unit),
food=CreateIngredientFood(name=bfi.food),
disable_amount=False,
quantity=bfi.amount,
note=bfi.note,
),
@@ -151,7 +150,6 @@ class NLPParser(ABCIngredientParser):
quantity=qty,
unit=CreateIngredientUnit(name=unit) if unit else None,
food=CreateIngredientFood(name=food) if food else None,
disable_amount=False,
note=note,
),
)

View File

@@ -173,7 +173,6 @@ class RecipeService(RecipeServiceBase):
show_assets=self.household.preferences.recipe_show_assets,
landscape_view=self.household.preferences.recipe_landscape_view,
disable_comments=self.household.preferences.recipe_disable_comments,
disable_amount=self.household.preferences.recipe_disable_amount,
)
else:
data.settings = RecipeSettings()

View File

@@ -74,7 +74,6 @@ class RegistrationService:
recipe_show_assets=self.registration.advanced,
recipe_landscape_view=False,
recipe_disable_comments=self.registration.advanced,
recipe_disable_amount=self.registration.advanced,
)
return HouseholdService.create_household(group_repos, household_data, household_preferences)