Skip to content

Commit

Permalink
Merge pull request #212 from wasade/name_error_on_response
Browse files Browse the repository at this point in the history
BUG: possible nameerror on response
  • Loading branch information
wasade committed Jun 12, 2020
2 parents a5c6aeb + 9ffe641 commit cdbf8d5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion microsetta_private_api/example/client_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,8 @@ def _get_kit(kit_name):
unable_to_validate_msg = "Unable to validate the kit name; please " \
"reload the page."
error_msg = None
response = None

try:
# call api and find out if kit name has unclaimed samples.
# NOT doing this through ApiRequest.get bc in this case
Expand All @@ -864,7 +866,11 @@ def _get_kit(kit_name):
error_msg = unable_to_validate_msg

if error_msg is not None:
return None, error_msg, response.status_code
if response is None:
return None, error_msg, 500
else:
return None, error_msg, response.status_code

return response.json(), None, response.status_code


Expand Down

0 comments on commit cdbf8d5

Please sign in to comment.