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

Fixed URL for uploading to the hub #5340

Merged
merged 3 commits into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
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
5 changes: 1 addition & 4 deletions openbb_terminal/core/session/hub_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,6 @@ def upload_config(
value: str,
type_: Literal["settings", "terminal_style"],
auth_header: str,
base_url: str = BackendEnvironment.BASE_URL,
timeout: int = TIMEOUT,
) -> Optional[requests.Response]:
"""Patch user configurations to the server.
Expand All @@ -390,8 +389,6 @@ def upload_config(
The type of the patch.
auth_header : str
The authorization header, e.g. "Bearer <token>".
base_url : str
The base url, by default BASE_URL
timeout : int
The timeout, by default TIMEOUT

Expand All @@ -409,7 +406,7 @@ def upload_config(
try:
console.print("Sending to OpenBB hub...")
response = requests.patch(
url=base_url + "terminal/user",
url=BackendEnvironment.BASE_URL + "terminal/user",
headers={"Authorization": auth_header},
json=data,
timeout=timeout,
Expand Down
9 changes: 3 additions & 6 deletions openbb_terminal/settings_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def call_colors(self, other_args: List[str]):
" Then, place the downloaded file 'openbb_config.richstyle.json'"
f" inside {get_current_user().preferences.USER_STYLES_DIRECTORY} or "
f"{STYLES_DIRECTORY_REPO}. If you have a hub account you can change colors "
f"here {BackendEnvironment.HUB_URL + 'app/terminal/theme'}.",
f"here {BackendEnvironment.BASE_URL + 'app/terminal/theme'}.",
)
if other_args and "-" not in other_args[0][0]:
other_args.insert(0, "-s")
Expand All @@ -246,7 +246,6 @@ def call_colors(self, other_args: List[str]):
value=ns_parser.style,
type_="settings",
auth_header=get_current_user().profile.get_auth_header(),
base_url=BackendEnvironment.HUB_URL,
)
console.print("")
console.print("Colors updated.")
Expand All @@ -267,7 +266,7 @@ def call_chart(self, other_args: List[str]):
dest="style",
choices=["dark", "light"],
help="Choose chart style. If you have a hub account you can change theme "
f"here {BackendEnvironment.HUB_URL + 'app/terminal/theme/charts-tables'}.",
f"here {BackendEnvironment.BASE_URL + 'app/terminal/theme/charts-tables'}.",
required="-h" not in other_args and "--help" not in other_args,
)
if other_args and "-" not in other_args[0][0]:
Expand All @@ -283,7 +282,6 @@ def call_chart(self, other_args: List[str]):
value=ns_parser.style,
type_="terminal_style",
auth_header=get_current_user().profile.get_auth_header(),
base_url=BackendEnvironment.HUB_URL,
)
console.print("")
theme.apply_style(ns_parser.style)
Expand All @@ -305,7 +303,7 @@ def call_table(self, other_args: List[str]):
dest="style",
choices=["dark", "light"],
help="Choose table style. If you have a hub account you can change theme "
f"here {BackendEnvironment.HUB_URL + 'app/terminal/theme/charts-tables'}.",
f"here {BackendEnvironment.BASE_URL + 'app/terminal/theme/charts-tables'}.",
required="-h" not in other_args and "--help" not in other_args,
)
if other_args and "-" not in other_args[0][0]:
Expand All @@ -321,7 +319,6 @@ def call_table(self, other_args: List[str]):
value=ns_parser.style,
type_="terminal_style",
auth_header=get_current_user().profile.get_auth_header(),
base_url=BackendEnvironment.HUB_URL,
)
console.print("")
console.print("Table theme updated.\n")
Expand Down
Loading