small fixy (#5318)

* check that routine title is valid

* more updates

* small fixes

* override local routine

* more improvements to routine logic

* --debug runs .dev

* few more updates

* small fix
This commit is contained in:
DidierRLopes
2023-08-13 20:16:35 -05:00
committed by GitHub
parent 3d6ad59643
commit 3e48648487
3 changed files with 5 additions and 3 deletions

View File

@@ -441,7 +441,7 @@ class Backend(PyWry):
self.check_backend()
endpoint = {True: "login", False: "logout"}[login]
if str(os.environ.get("DEBUG_MODE", "false")).lower() != "true":
if str(os.environ.get("DEBUG_MODE", "false")).lower() == "true":
json_url = f"https://my.openbb.dev/{endpoint}?pywry=true"
else:
json_url = f"https://my.openbb.co/{endpoint}?pywry=true"

View File

@@ -1,6 +1,6 @@
from os import environ
if str(environ.get("DEBUG_MODE", "false")).lower() != "true":
if str(environ.get("DEBUG_MODE", "false")).lower() == "true":
BASE_URL = "https://payments.openbb.dev/"
HUB_URL = "https://my.openbb.dev/"
else:

View File

@@ -479,10 +479,12 @@ def upload_routine(
if response.status_code == 200:
username = get_current_user().profile.username
console.print("[green]Successfully uploaded your routine.[/green]")
if str(environ.get("DEBUG_MODE", "false")).lower() != "true":
if str(environ.get("DEBUG_MODE", "false")).lower() == "true":
run_env = "dev"
else:
run_env = "co"
if public:
console.print(f"\n[yellow]Share or edit it at https://my.openbb.{run_env}/u/{username}/routine/{name.replace(' ', '-')}[/yellow]")
else: