Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch UserModel on logs #4474

Merged
merged 1 commit into from
Mar 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions openbb_terminal/core/log/generation/settings_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
# IMPORTATION INTERNAL
from openbb_terminal import config_terminal as cfg
from openbb_terminal.core.log.generation.common import do_rollover
from openbb_terminal.core.models.credentials_model import CredentialsModel
from openbb_terminal.core.models.user_model import UserModel
from openbb_terminal.core.session.current_user import get_current_user
from openbb_terminal.terminal_helper import is_installer

Expand Down Expand Up @@ -89,10 +91,13 @@ def log_config_terminal() -> None:

for item in dir(cfg):
prop = getattr(cfg, item)
# pylint: disable=too-many-boolean-expressions
if (
not item.startswith("__")
and not isinstance(prop, FunctionType)
and not isinstance(prop, ModuleType)
and not isinstance(prop, UserModel)
and not isinstance(prop, CredentialsModel)
and not any(substring in item for substring in SENSITIVE_WORDS)
):
config_terminal_dict[item] = str(prop)
Expand All @@ -112,6 +117,8 @@ def log_feature_flags() -> None:
not item.startswith("__")
and not isinstance(prop, FunctionType)
and not isinstance(prop, ModuleType)
and not isinstance(prop, UserModel)
and not isinstance(prop, CredentialsModel)
):
feature_flags_dict[item] = str(prop)

Expand Down