mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-29 05:21:48 +00:00
clear and patch
This commit is contained in:
@@ -160,7 +160,7 @@ class AccountController(BaseController):
|
||||
)
|
||||
if i.lower() in ["y", "yes"]:
|
||||
console.print("")
|
||||
Hub.clear_user_configs()
|
||||
Hub.clear_user_configs(auth_header=User.get_auth_header())
|
||||
else:
|
||||
console.print("\nAborted.", style="info")
|
||||
|
||||
|
||||
@@ -110,6 +110,7 @@ class FeatureFlagsController(BaseController):
|
||||
key=name,
|
||||
value=str(value),
|
||||
type_="settings",
|
||||
auth_header=User.get_auth_header(),
|
||||
)
|
||||
|
||||
def call_overwrite(self, _):
|
||||
|
||||
@@ -247,7 +247,12 @@ def set_key(env_var_name: str, env_var_value: str, persist: bool = False) -> Non
|
||||
and env_var_name not in cfg.SENSITIVE_KEYS
|
||||
and env_var_name.startswith("API_")
|
||||
):
|
||||
patch_user_configs(key=env_var_name, value=env_var_value, type_="keys")
|
||||
patch_user_configs(
|
||||
key=env_var_name,
|
||||
value=env_var_value,
|
||||
type_="keys",
|
||||
auth_header=User.get_auth_header(),
|
||||
)
|
||||
|
||||
|
||||
def get_keys(show: bool = False) -> pd.DataFrame:
|
||||
|
||||
@@ -194,7 +194,7 @@ def patch_user_configs(
|
||||
type_ : str
|
||||
The type of the patch, either "keys" or "settings".
|
||||
auth_header : str
|
||||
The authorization header.
|
||||
The authorization header, e.g. "Bearer <token>".
|
||||
base_url : str
|
||||
The base url, by default BASE_URL
|
||||
timeout : int
|
||||
@@ -236,16 +236,16 @@ def patch_user_configs(
|
||||
|
||||
|
||||
def clear_user_configs(
|
||||
base_url: str = BASE_URL, auth_header: Optional[str] = None, timeout: int = TIMEOUT
|
||||
auth_header: str, base_url: str = BASE_URL, timeout: int = TIMEOUT
|
||||
) -> Optional[requests.Response]:
|
||||
"""Clear user configurations to the server.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
auth_header : str
|
||||
The authorization header, e.g. "Bearer <token>".
|
||||
base_url : str
|
||||
The base url, by default BASE_URL
|
||||
auth_header : Optional[str]
|
||||
The authorization header, by default None
|
||||
timeout : int
|
||||
The timeout, by default TIMEOUT
|
||||
|
||||
@@ -254,8 +254,6 @@ def clear_user_configs(
|
||||
Optional[requests.Response]
|
||||
The response from the put request.
|
||||
"""
|
||||
auth_header = User.get_auth_header() if auth_header is None else auth_header
|
||||
|
||||
data: Dict[str, dict] = {"features_keys": {}, "features_settings": {}}
|
||||
|
||||
try:
|
||||
|
||||
@@ -165,6 +165,7 @@ class SettingsController(BaseController):
|
||||
key=name,
|
||||
value=str(value),
|
||||
type_="settings",
|
||||
auth_header=User.get_auth_header(),
|
||||
)
|
||||
|
||||
@log_start_end(log=logger)
|
||||
|
||||
Reference in New Issue
Block a user