SampleOAuth2_UsingPythonClient icon indicating copy to clipboard operation
SampleOAuth2_UsingPythonClient copied to clipboard

Fix TypeError returned when insufficient Authorization

Open middaugh opened this issue 2 years ago • 0 comments
trafficstars

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

middaugh avatar Jun 01 '23 07:06 middaugh