From 4a9b911940ad055a683660a4939c6d664edf5a10 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 22 Jun 2020 14:00:30 +0200 Subject: [PATCH] Fix order panel crash if there were products that could be displayed --- worker.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/worker.py b/worker.py index 3aa48c8..c037f05 100644 --- a/worker.py +++ b/worker.py @@ -402,7 +402,7 @@ class Worker(threading.Thread): if product.price is None: continue # Send the message without the keyboard to get the message id - message = product.send_as_message(self.chat.id) + message = product.send_as_message(loc=self.loc, chat_id=self.chat.id) # Add the product to the cart cart[message['result']['message_id']] = [product, 0] # Create the inline keyboard to add the product to the cart @@ -806,9 +806,12 @@ class Worker(threading.Thread): reply_markup=telegram.ReplyKeyboardMarkup(keyboard, one_time_keyboard=True), ) # Wait for a reply from the user - selection = self.__wait_for_specific_message([self.loc.get("menu_products"), self.loc.get("menu_orders"), - self.loc.get("menu_user_mode"), self.loc.get("menu_edit_credit"), - self.loc.get("menu_transactions"), self.loc.get("menu_csv"), + selection = self.__wait_for_specific_message([self.loc.get("menu_products"), + self.loc.get("menu_orders"), + self.loc.get("menu_user_mode"), + self.loc.get("menu_edit_credit"), + self.loc.get("menu_transactions"), + self.loc.get("menu_csv"), self.loc.get("menu_edit_admins")]) # If the user has selected the Products option... if selection == self.loc.get("menu_products"):