SampleOAuth2_UsingPythonClient
SampleOAuth2_UsingPythonClient copied to clipboard
Fix TypeError returned when insufficient Authorization
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