diff --git a/app/templates/order.html b/app/templates/order.html index 7d091a7..cc3bba6 100644 --- a/app/templates/order.html +++ b/app/templates/order.html @@ -53,8 +53,8 @@ {{ util.render_form_field_errors(form.dish_id) }} + {% if dish and dish.choices %} - {% for (choice_type, choice) in dish.choices %}

diff --git a/app/views/order.py b/app/views/order.py index 8b407cf..c19a7c8 100644 --- a/app/views/order.py +++ b/app/views/order.py @@ -134,8 +134,8 @@ def order_item_create(order_id: int) -> typing.Any: form.populate(current_order.location) if form.is_submitted(): - form_for_dish = request.form.get("form_for_dish_id") - dish_was_changed = form_for_dish is not None and form_for_dish != dish_id + form_for_dish = request.form["form_for_dish"] + dish_was_changed = form_for_dish != "" and form_for_dish != dish_id # The form's validation tests that dish_id is valid and gives a friendly error if it's not choices = location.dish_by_id(form.dish_id.data).choices