Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal server error when qbo api call response not ok #6

Open
michielbdejong opened this issue Jul 6, 2021 · 2 comments
Open

Internal server error when qbo api call response not ok #6

michielbdejong opened this issue Jul 6, 2021 · 2 comments

Comments

@michielbdejong
Copy link

To reproduce, revoke the token and then try to do an API call:

Internal Server Error: /quickbooks/qbo_request
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/Users/michiel/gh/pondersource/peppol-python-demo/quickbooks/views.py", line 122, in qbo_request
    return HttpResponse(' '.join([response.content, str(response.status_code)]))
TypeError: sequence item 0: expected str instance, bytes found
michielbdejong added a commit to michielbdejong/SampleOAuth2_UsingPythonClient that referenced this issue Jul 6, 2021
@michielbdejong
Copy link
Author

Apparently response.content contains a bytes buffer and not a string?

@michielbdejong
Copy link
Author

michielbdejong commented Jul 6, 2021

Ah btw this is with intuit-oauth==1.2.3 and requests==2.25.1.

I didn't test it with intuit-oauth==1.1.1 and requests==2.19.1 which is what https://github.com/IntuitDeveloper/SampleOAuth2_UsingPythonClient/blob/master/requirements.txt#L1 still specifies. Not sure if that could have caused it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant