lower before compare

This commit is contained in:
Diogo Sousa
2023-02-05 13:22:02 +00:00
parent ee34a1f278
commit 3f9fe8b685
3 changed files with 5 additions and 5 deletions

View File

@@ -214,7 +214,7 @@ def __patch_controller_functions(controller):
),
]
if environ.get("DEBUG_MODE", "false") != "true":
if str(environ.get("DEBUG_MODE", "false")).lower() != "true":
rich.start()
patched_function_list = []
for patcher in patcher_list:
@@ -222,7 +222,7 @@ def __patch_controller_functions(controller):
yield patched_function_list
if environ.get("DEBUG_MODE", "false") != "true":
if str(environ.get("DEBUG_MODE", "false")).lower() != "true":
rich.stop()
for patcher in patcher_list:
patcher.stop()
@@ -319,7 +319,7 @@ def build_controller_choice_map(controller) -> dict:
argument_parser=argument_parser
)
except Exception as exception:
if environ.get("DEBUG_MODE", "false") == "true":
if str(environ.get("DEBUG_MODE", "false")).lower() == "true":
raise Exception(
f"On command : `{command}`.\n{str(exception)}"
) from exception

View File

@@ -60,7 +60,7 @@ def log_start_end(func=None, log=None):
extra={"func_name_override": func.__name__},
)
if os.environ.get("DEBUG_MODE") == "true":
if str(os.environ.get("DEBUG_MODE")).lower() == "true":
value = func(*args, **kwargs)
log.info("END", extra={"func_name_override": func.__name__})
return value

View File

@@ -195,7 +195,7 @@ class PortfolioEngine:
# Load transactions from file
if path.endswith(".xlsx"):
if environ.get("DEBUG_MODE", "false") != "true":
if str(environ.get("DEBUG_MODE", "false")).lower() != "true":
warnings.filterwarnings(
"ignore", category=UserWarning, module="openpyxl"
)