shopping list fixes

This commit is contained in:
vabene1111
2025-03-14 14:07:33 +01:00
parent f59c5ae16e
commit 1fd0028351
2 changed files with 7 additions and 4 deletions

View File

@@ -153,8 +153,9 @@ class RecipeShoppingEditor():
return True
for sle in ShoppingListEntry.objects.filter(list_recipe=self._shopping_list_recipe):
sle.amount = sle.ingredient.amount * Decimal(self._servings_factor)
sle.save()
if sle.ingredient: # TODO temporarily dont scale manual entries until ingredient_amount or some other base amount has been migrated to SLE
sle.amount = sle.ingredient.amount * Decimal(self._servings_factor)
sle.save()
self._shopping_list_recipe.servings = self.servings
self._shopping_list_recipe.save()
return True