Fred808 commited on
Commit
60a6f5a
·
verified ·
1 Parent(s): 5debbea

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -763,12 +763,12 @@ async def process_order_flow(user_id: str, message: str) -> str:
763
  quantity_total = sum(state.data["orders"].values())
764
  total_price = 0
765
  for dish, qty in state.data["orders"].items():
766
- total_price += (await get_dish_price(dish)) * qty
767
  total_price += shipping_cost
768
  else:
769
  dish_summary = state.data.get("dish", "")
770
  quantity_total = state.data.get("quantity", 1)
771
- dish_price = await get_dish_price(dish_summary)
772
  total_price = (quantity_total * dish_price) + shipping_cost
773
 
774
  return (f"Order Summary:\n"
@@ -793,14 +793,14 @@ async def process_order_flow(user_id: str, message: str) -> str:
793
  if "orders" in state.data:
794
  total_price = 0
795
  for dish, qty in state.data["orders"].items():
796
- total_price += (await get_dish_price(dish)) * qty
797
  total_price += state.data.get("shipping_cost", 0)
798
  dish_summary = ", ".join(state.data["orders"].keys())
799
  quantity_total = sum(state.data["orders"].values())
800
  else:
801
  dish_summary = state.data.get("dish", "")
802
  quantity_total = state.data.get("quantity", 1)
803
- dish_price = await get_dish_price(dish_summary)
804
  total_price = (quantity_total * dish_price) + state.data.get("shipping_cost", 0)
805
 
806
  state.data["price"] = str(total_price)
 
763
  quantity_total = sum(state.data["orders"].values())
764
  total_price = 0
765
  for dish, qty in state.data["orders"].items():
766
+ total_price += (get_dish_price(dish)) * qty
767
  total_price += shipping_cost
768
  else:
769
  dish_summary = state.data.get("dish", "")
770
  quantity_total = state.data.get("quantity", 1)
771
+ dish_price = get_dish_price(dish_summary)
772
  total_price = (quantity_total * dish_price) + shipping_cost
773
 
774
  return (f"Order Summary:\n"
 
793
  if "orders" in state.data:
794
  total_price = 0
795
  for dish, qty in state.data["orders"].items():
796
+ total_price += (get_dish_price(dish)) * qty
797
  total_price += state.data.get("shipping_cost", 0)
798
  dish_summary = ", ".join(state.data["orders"].keys())
799
  quantity_total = sum(state.data["orders"].values())
800
  else:
801
  dish_summary = state.data.get("dish", "")
802
  quantity_total = state.data.get("quantity", 1)
803
+ dish_price = get_dish_price(dish_summary)
804
  total_price = (quantity_total * dish_price) + state.data.get("shipping_cost", 0)
805
 
806
  state.data["price"] = str(total_price)