From d1b58ea5b70e66eb14f082c0f04c8752c52f728a Mon Sep 17 00:00:00 2001 From: Laetitia Getti Date: Mon, 24 Jul 2023 18:15:48 +0200 Subject: [PATCH] values remain in the form when an error is raised --- .../templates/order/grouped_order_detail.html | 18 ++++++++++-------- la_chariotte/order/tests/test_views.py | 14 ++++++++++---- la_chariotte/order/views/order.py | 10 ++++++++++ 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/la_chariotte/order/templates/order/grouped_order_detail.html b/la_chariotte/order/templates/order/grouped_order_detail.html index ff1c7d8..4565b50 100644 --- a/la_chariotte/order/templates/order/grouped_order_detail.html +++ b/la_chariotte/order/templates/order/grouped_order_detail.html @@ -79,7 +79,7 @@ {% csrf_token %} {{ item.name }} {{ item.price }} € - + {% if item.get_remaining_nb is not null %} {% if item.get_remaining_nb == 0 %}Produit épuisé @@ -104,7 +104,7 @@

{{ item.price }} €

{% if error_message %}

{{ error_message }}

{% endif %} + {% comment %} The value attribute is used when the form is redered with error messages, + in order not to loose entered values {% endcomment %}

Vos informations

-

+

-

+

-

+

-

+

-

-

+

+