Beef up the Production check a little and do true comparison correctly.

This commit is contained in:
Ben Rog-Wilhelm 2022-11-21 09:38:00 -06:00 committed by Ben Rog-Wilhelm
parent 2067875c6a
commit 18437003cf
4 changed files with 12 additions and 3 deletions

View file

@ -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()