diff --git a/app/app.py b/app/app.py
index 3553d2a..c2d9e05 100755
--- a/app/app.py
+++ b/app/app.py
@@ -19,7 +19,7 @@ from login import init_login
from markupsafe import Markup
from models import db
from models.anonymous_user import AnonymouseUser
-from utils import euro_string, price_range_string
+from utils import euro_string, price_range_string, ignore_none
from zeus import init_oauth
@@ -151,6 +151,7 @@ def add_template_filters(app: Flask) -> None:
app.template_filter("price_range")(price_range_string)
app.template_filter("any")(any)
app.template_filter("all")(all)
+ app.template_filter("ignore_none")(ignore_none)
def create_app():
diff --git a/app/templates/order.html b/app/templates/order.html
index 39d43c7..ffb267b 100644
--- a/app/templates/order.html
+++ b/app/templates/order.html
@@ -281,7 +281,7 @@
{{ "disabled" if not order.can_modify_payment(current_user.id) }}>
- {{ order_items | map(attribute="price") | sum | euro }}
+ {{ order_items | map(attribute="price") | ignore_none | sum | euro }}
{% if paid %}{% endif %}
diff --git a/app/utils.py b/app/utils.py
index 80556f2..9ef9037 100644
--- a/app/utils.py
+++ b/app/utils.py
@@ -4,10 +4,12 @@ import re
from typing import Iterable, Optional
-def euro_string(value: int, unit="€ ") -> str:
+def euro_string(value: Optional[int], unit="€ ") -> str:
"""
Convert cents to string formatted euro
"""
+ if value is None:
+ return "✗"
euro, cents = divmod(value, 100)
if cents:
return f"{unit}{euro}.{cents:02}"