From 6fd5bd1020dff46fef89139fd77cb4fc8b229855 Mon Sep 17 00:00:00 2001 From: Stan James Date: Mon, 27 Jan 2020 20:14:20 -0800 Subject: [PATCH] Fix disabling of `DEBUG` and `ADMIN_EXEMPT` As written (by unknown idiot), there was no way to actually set `DEBUG` and `ADMIN_EXEMPT` env vars in a way that disabled them (as claimed by docs), as their value was converted to uppercase and then tested for a lower case `false`. Fixed to forcing to _lowercase_ with `.lower()`. --- bot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index 6303b98..eac1a92 100644 --- a/bot.py +++ b/bot.py @@ -26,12 +26,12 @@ class TelegramMonitorBot: def __init__(self): self.debug = ( (os.environ.get('DEBUG') is not None) and - (os.environ.get('DEBUG').upper() != "false")) + (os.environ.get('DEBUG').lower() != "false")) # Are admins exempt from having messages checked? self.admin_exempt = ( (os.environ.get('ADMIN_EXEMPT') is not None) and - (os.environ.get('ADMIN_EXEMPT').upper() != "false")) + (os.environ.get('ADMIN_EXEMPT').lower() != "false")) if (self.debug): print("🔵 debug:", self.debug)