Squashed commit of the following:

commit f8f08ae337
Author: smilerz <smilerz@gmail.com>
Date:   Wed Sep 6 10:27:43 2023 -0500

    respect ignore_shopping flag
This commit is contained in:
smilerz
2023-09-12 09:47:55 -05:00
parent 847fceaf10
commit a0256b607e
3 changed files with 173 additions and 168 deletions

View File

@@ -176,7 +176,7 @@ class RecipeShoppingEditor():
if not ingredients:
return
elif isinstance(ingredients, list):
ingredients = Ingredient.objects.filter(id__in=ingredients)
ingredients = Ingredient.objects.filter(id__in=ingredients, food__ignore_shopping=False)
existing = self._shopping_list_recipe.entries.filter(ingredient__in=ingredients).values_list('ingredient__pk', flat=True)
add_ingredients = ingredients.exclude(id__in=existing)