booleanize value for ternary
This commit is contained in:
parent
3ff67fc217
commit
035b4b95b0
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue