mirror of
https://github.com/Steffo99/greed.git
synced 2024-11-21 13:34:18 +00:00
Fix order panel crash if there were products that could be displayed
This commit is contained in:
parent
d7f1c83ef6
commit
4a9b911940
1 changed files with 7 additions and 4 deletions
11
worker.py
11
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"):
|
||||
|
|
Loading…
Reference in a new issue