also strip strings to avoid spaces breaking match

This commit is contained in:
Brian Coca 2017-08-23 16:01:02 -04:00
parent cc802bc883
commit 7b73ee0818

View file

@ -16,7 +16,7 @@ def boolean(value, strict=True):
normalized_value = value
if isinstance(value, (text_type, binary_type)):
normalized_value = to_text(value, errors='surrogate_or_strict').lower()
normalized_value = to_text(value, errors='surrogate_or_strict').lower().strip()
if normalized_value in BOOLEANS_TRUE:
return True