Skip to content

Commit

Permalink
Check for other valid return codes
Browse files Browse the repository at this point in the history
200, 201 and 202 are valid return codes that will contain a JSON, so we
should check for them also.
  • Loading branch information
alvarolopez committed Apr 10, 2015
1 parent 9bacf8e commit f75d2d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ooi/api/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def get_from_response(response, element, default):
:param element: The element to look for in the JSON body
:param default: The default element to be returned if not found.
"""
if response.status_int == 200:
if response.status_int in [200, 201, 202]:
return response.json_body.get(element, default)
else:
raise exception_from_response(response)
Expand Down

0 comments on commit f75d2d6

Please sign in to comment.