From cf27a7de8a45c014cd3aa9e9f1ff5bb067d654ec Mon Sep 17 00:00:00 2001 From: Midgard Date: Mon, 2 May 2022 22:04:45 +0200 Subject: [PATCH] For loops don't work in this template engine --- app/templates/order.html | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/app/templates/order.html b/app/templates/order.html index 313e164..a9a6dcd 100644 --- a/app/templates/order.html +++ b/app/templates/order.html @@ -277,14 +277,8 @@ {% set paid = order_items | map(attribute="paid") | all %} - {% set can_modify_payment = True %} - {% for order_item in order_items %} - {% if not order_item.can_modify_payment(order.id, current_user.id) %} - {% set can_modify_payment = False %} - {% endif %} - {% endfor %} + {{ "disabled" if not order.can_modify_payment(current_user.id) }}> {{ order_items | map(attribute="price") | sum | euro }}