Skip to content

Commit

Permalink
feat: handle when api return None of api_account_ids
Browse files Browse the repository at this point in the history
  • Loading branch information
Romazes committed Sep 19, 2024
1 parent 824345e commit 68caade
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lean/models/json_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ def config_build(self,
for account_id in api_account_ids)):
logger.info(f'The account ID: {user_provide_account_id}')
inner_config._value = user_provide_account_id
elif not api_account_ids:
logger.warn(f"The '{self._display_name}' oauth authentication returned no account id, "
f"using provided account id: '{user_provide_account_id}'")
inner_config._value = user_provide_account_id
else:
raise ValueError(f"The provided account id '{user_provide_account_id} is not valid, "
f"available: {api_account_ids}")
Expand Down

0 comments on commit 68caade

Please sign in to comment.