From f0561bcd71efb0f1c4a0683396b27cb44c448600 Mon Sep 17 00:00:00 2001 From: Midgard Date: Mon, 21 Jun 2021 02:08:32 +0200 Subject: [PATCH] Remove pills introduced in previous commit --- app/models/order.py | 7 ++----- app/templates/order.html | 7 +++---- app/templates/order_items.html | 4 +--- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/app/models/order.py b/app/models/order.py index ec5d3fb..b990f04 100644 --- a/app/models/order.py +++ b/app/models/order.py @@ -71,7 +71,7 @@ class Order(db.Model): return list(sorted(group.items(), key=lambda t: (t[0] or "", t[1] or ""))) def group_by_dish(self) \ - -> typing.List[typing.Tuple[str, int, typing.List[typing.Tuple[typing.List[str], typing.List]]]]: + -> typing.List[typing.Tuple[str, int, typing.List[typing.Tuple[str, typing.List]]]]: "Group items of an Order by dish" group: typing.Dict[str, typing.Dict[str, typing.List]] = \ defaultdict(lambda: defaultdict(list)) @@ -85,10 +85,7 @@ class Order(db.Model): # Amount of items of this dish sum(map(len, comment_group.values())), sorted( - ( - (list(map(str.strip, comment.split(";"))) if comment else []), - sorted(items, key=lambda x: (x.for_name or "")) - ) + (comment, sorted(items, key=lambda x: (x.for_name or ""))) for comment, items in comment_group.items() ) ) diff --git a/app/templates/order.html b/app/templates/order.html index 52f2720..3e3b4cb 100644 --- a/app/templates/order.html +++ b/app/templates/order.html @@ -241,10 +241,9 @@ {% if has_comments -%}