From 18e53aa03f8a08b9787eeefe339511437d8284a9 Mon Sep 17 00:00:00 2001 From: smilerz Date: Fri, 25 Feb 2022 07:59:20 -0600 Subject: [PATCH] return distinct shopping entries --- cookbook/helper/shopping_helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/helper/shopping_helper.py b/cookbook/helper/shopping_helper.py index d8e8046e9..1783ca421 100644 --- a/cookbook/helper/shopping_helper.py +++ b/cookbook/helper/shopping_helper.py @@ -35,7 +35,7 @@ def shopping_helper(qs, request): qs = qs.filter(Q(checked=False) | Q(completed_at__gte=week_ago)) supermarket_order = ['checked'] + supermarket_order - return qs.order_by(*supermarket_order).select_related('unit', 'food', 'ingredient', 'created_by', 'list_recipe', 'list_recipe__mealplan', 'list_recipe__recipe') + return qs.distinct().order_by(*supermarket_order).select_related('unit', 'food', 'ingredient', 'created_by', 'list_recipe', 'list_recipe__mealplan', 'list_recipe__recipe') class RecipeShoppingEditor():