booleanize value for ternary

This commit is contained in:
Brian Coca 2017-07-11 13:05:04 -04:00
parent 3ff67fc217
commit 035b4b95b0

View file

@ -205,7 +205,7 @@ def regex_search(value, regex, *args, **kwargs):
def ternary(value, true_val, false_val):
''' value ? true_val : false_val '''
if value:
if bool(value):
return true_val
else:
return false_val