Skip to content

Commit

Permalink
rename: get project id method
Browse files Browse the repository at this point in the history
refactor: return auth url with any project_id
  • Loading branch information
Romazes committed Dec 20, 2024
1 parent e0e6b54 commit be9d33f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions lean/components/api/auth0_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,7 @@ def authorize(brokerage_id: str, logger: Logger, project_id: int) -> None:
"""
from webbrowser import open

full_url = f"{API_BASE_URL}live/auth0/authorize?brokerage={brokerage_id}"

if project_id > 0:
full_url += f"&projectId={project_id}"
full_url = f"{API_BASE_URL}live/auth0/authorize?brokerage={brokerage_id}&projectId={project_id}"

logger.info(f"Please open the following URL in your browser to authorize the LEAN CLI.")
logger.info(full_url)
Expand Down
2 changes: 1 addition & 1 deletion lean/components/config/lean_config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def get_complete_lean_config(self,

if algorithm_file and len(algorithm_file.name) > 0:
config.get("job-project-id", self._project_config_manager.get_local_id(algorithm_file.parent))
config["project-id"] = self._project_config_manager.get_cloud_id(algorithm_file.parent)
config["project-id"] = self._project_config_manager.get_project_id_from_project_config(algorithm_file.parent)

if algorithm_file.name.endswith(".py"):
config["algorithm-type-name"] = algorithm_file.name.split(".")[0]
Expand Down
2 changes: 1 addition & 1 deletion lean/components/config/project_config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def get_local_id(self, project_directory: Path) -> int:

return project_id

def get_cloud_id(self, project_directory: Path) -> int:
def get_project_id_from_project_config(self, project_directory: Path) -> int:
"""
Retrieves the project ID from the configuration.
Expand Down

0 comments on commit be9d33f

Please sign in to comment.