Skip to content

Fix TypeError returned when insufficient Authorization - #9

Open
middaugh wants to merge 1 commit into
IntuitDeveloper:masterfrom
middaugh:master
Open

middaugh wants to merge 1 commit into
IntuitDeveloper:masterfrom
middaugh:master

Conversation

@middaugh

@middaugh middaugh commented Jun 1, 2023

Copy link
Copy Markdown

If app doesn't have authentication rights, then the code sends a type error. Fixed by wrapping casting response.content to string. User can then see the authorization error message in the app.

Example error that was previously returned:

Error: SampleOAuth2_UsingPythonClient\app\views.py", line 122, in qbo_request
return HttpResponse(b' '.join([response.content, str(response.status_code)]))
TypeError: sequence item 1: expected a bytes-like object, str found

If app doesn't have authentication rights, then the code sends a type error. Fixed by wrapping casting response.content to string -- user can then see the authorization error message in the app.

Error: SampleOAuth2_UsingPythonClient\app\views.py", line 122, in qbo_request
    return HttpResponse(b' '.join([response.content, str(response.status_code)]))
TypeError: sequence item 1: expected a bytes-like object, str found
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant