Beef up the Production check a little and do true comparison correctly.
This commit is contained in:
parent
2067875c6a
commit
18437003cf
4 changed files with 12 additions and 3 deletions
|
@ -1,4 +1,11 @@
|
|||
|
||||
# clean strings for searching
|
||||
def sql_ilike_clean(my_str):
|
||||
return my_str.replace(r'\\', '').replace('_', r'\_').replace('%', '').strip()
|
||||
return my_str.replace(r'\\', '').replace('_', r'\_').replace('%', '').strip()
|
||||
|
||||
def bool_from_string(str_in: str) -> bool:
|
||||
if str_in.lower() in ("yes", "true", "t", "1"):
|
||||
return True
|
||||
if str_in.lower() in ("no", "false", "f", "0"):
|
||||
return False
|
||||
raise ValueError()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue