From 23fb05bdcf1572fbc2fe803a1fe3196fc3c5f4c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Poulain?= Date: Fri, 10 May 2024 09:29:07 +0200 Subject: [PATCH] =?UTF-8?q?fix(admin):=20=C3=A9vite=20un=20bug=20en=20cas?= =?UTF-8?q?=20de=20commande=20sans=20r=C3=A9servation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fournée/core/admin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fournée/core/admin.py b/fournée/core/admin.py index e64aaf4..3936e06 100644 --- a/fournée/core/admin.py +++ b/fournée/core/admin.py @@ -244,7 +244,7 @@ class FournéeAdmin(nested_admin.NestedModelAdmin): elif masse_coulée < masse_commandée: problems = f"{(masse_commandée - masse_coulée).normalize()} kg coulés en moins !!" extra_context["coulées"].append([problems, tmp]) - pains = set(obj.commande_set.values_list("pains__nom", flat=True)) + pains = set(obj.commande_set.exclude(réservation__isnull=True).values_list("pains__nom", flat=True)) totaux = [] for i, _ in ingrédients: