mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-12-01 05:33:37 +00:00
fix flair default
This commit is contained in:
@@ -55,7 +55,9 @@ def login(session: dict) -> LoginStatus:
|
||||
email = configs.get("email", "")
|
||||
User.load_user_info(session, email)
|
||||
Local.apply_configs(configs=configs)
|
||||
User.update_flair()
|
||||
User.update_flair(
|
||||
flair=configs.get("features_settings", {}).get("USE_FLAIR", None)
|
||||
)
|
||||
return LoginStatus.SUCCESS
|
||||
return LoginStatus.FAILED
|
||||
return LoginStatus.NO_RESPONSE
|
||||
|
||||
@@ -34,12 +34,12 @@ class User:
|
||||
}
|
||||
|
||||
@staticmethod
|
||||
def update_flair():
|
||||
MAX_FLAIR_LEN = 20
|
||||
username = User._EMAIL[: User._EMAIL.find("@")]
|
||||
username = "[" + username[:MAX_FLAIR_LEN] + "]"
|
||||
|
||||
if obbff.USE_FLAIR == ":openbb":
|
||||
def update_flair(flair: str):
|
||||
"""Update flair if user has not changed it."""
|
||||
if flair is None:
|
||||
MAX_FLAIR_LEN = 20
|
||||
username = User._EMAIL[: User._EMAIL.find("@")]
|
||||
username = "[" + username[:MAX_FLAIR_LEN] + "]"
|
||||
setattr(obbff, "USE_FLAIR", username + " 🦋")
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user