Skip to content

Commit

Permalink
Return None while getting models if we are not authenticated
Browse files Browse the repository at this point in the history
  • Loading branch information
titilambert committed Aug 18, 2017
1 parent 5904287 commit c8e1ca3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pynuance/mix.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ def list_models(username=None, password=None, cookies_file=None): # pylint: dis
"""Get list of models/project from Nuance Mix."""
result = requests.get("https://developer.nuance.com/mix/nlu/api/v1/projects",
cookies=cookies) # pylint: disable=E0602
if result.status_code != 200:
return None
return result.json().get("data", [])


Expand Down

0 comments on commit c8e1ca3

Please sign in to comment.