From d65367327750d64f9a00a624149129c35a7060af Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sat, 24 Feb 2018 23:01:44 -0800 Subject: [PATCH] Update truthystring to return bool, not given int. --- etiquette/helpers.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/etiquette/helpers.py b/etiquette/helpers.py index 4afb15a..b5ac6f1 100644 --- a/etiquette/helpers.py +++ b/etiquette/helpers.py @@ -358,8 +358,12 @@ def truthystring(s): Case insensitive. ''' - if isinstance(s, (bool, int)) or s is None: - return s + if s is None: + return None + + if isinstance(s, (bool, int)): + return bool(s) + s = s.lower() if s in constants.TRUTHYSTRING_TRUE: return True