Skip to content

Commit

Permalink
Merge pull request #183 from onuralpszr/invalid_api_key_check
Browse files Browse the repository at this point in the history
fix: 🐛 check for rlogin is None
  • Loading branch information
capjamesg authored Sep 13, 2023
2 parents 46a2523 + 28c8593 commit f26827a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion roboflow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ def login(workspace=None, force=False):

if os.path.isfile(conf_location) and not force:
write_line(
"You are already logged into Roboflow. To make a different login, run roboflow.login(force=True)."
"You are already logged into Roboflow. To make a different login,"
"run roboflow.login(force=True)."
)
return None
# we could eventually return the workspace object here
Expand All @@ -114,6 +115,10 @@ def login(workspace=None, force=False):

if r_login.status_code == 200:
r_login = r_login.json()
if r_login is None:
raise ValueError(
"Invalid API key. " "Please check your API key and try again."
)

# make config directory if it doesn't exist
if not os.path.exists(os.path.dirname(conf_location)):
Expand Down

0 comments on commit f26827a

Please sign in to comment.