Skip to content

Commit 7c82189

Browse files
committed
Check if status for getCompanyInfo request not 200
1 parent b369f9a commit 7c82189

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sampleAppOAuth2/services.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ def getCompanyInfo(access_token, realmId):
8888
headers = {'Authorization': auth_header, 'accept': 'application/json'}
8989
r = requests.get(settings.SANDBOX_QBO_BASEURL + route, headers=headers)
9090
status_code = r.status_code
91+
if status_code != 200:
92+
response = ''
93+
return response, status_code
9194
response = json.loads(r.text)
9295
return response, status_code
9396

0 commit comments

Comments
 (0)