From 266ca37e8e19b82a6db53f49534dec51eebf080d Mon Sep 17 00:00:00 2001 From: Santiago Valenzuela Date: Wed, 9 Dec 2020 19:10:45 -0600 Subject: [PATCH] Hide admin menu when category_mode = false in config.toml. --- worker.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/worker.py b/worker.py index a8f613c..6d7f483 100644 --- a/worker.py +++ b/worker.py @@ -197,7 +197,6 @@ class Worker(threading.Thread): self.__create_localization() # Capture exceptions that occour during the conversation # noinspection PyBroadException - log.debug("TEST") log.debug(self.admin) try: # Welcome the user to the bot @@ -1020,12 +1019,12 @@ class Worker(threading.Thread): while True: # Create a keyboard with the admin main menu based on the admin permissions specified in the db keyboard = [] - if self.admin.edit_products and self.admin.edit_categories: + if self.admin.edit_products and self.admin.edit_categories and CategoryMode: keyboard.append([self.loc.get("menu_products"), self.loc.get("menu_categories")]) else: if self.admin.edit_products: keyboard.append([self.loc.get("menu_products")]) - if self.admin.edit_categories: + if self.admin.edit_categories and CategoryMode: keyboard.append([self.loc.get("menu_categories")]) if self.admin.receive_orders: keyboard.append([self.loc.get("menu_orders")])