1
Fork 0
mirror of https://github.com/Steffo99/greed.git synced 2024-11-24 06:44:19 +00:00

Hide admin menu when category_mode = false in config.toml.

This commit is contained in:
Santiago Valenzuela 2020-12-09 19:10:45 -06:00
parent 4bd2413dce
commit 266ca37e8e

View file

@ -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")])