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

Only convert request payloads to JSON a single time #51

Conversation

sangaline
Copy link
Contributor

The BaseClient._call_raw() method currently catches HubspotUnauthorized errors, and then recursively calls itself after refreshing the OAuth2 tokens. This results in BaseClient._prepare_request() being called a second time which results in json.dumps() being called on the data payload twice. A payload like {"a": 1} then becomes "{\"a\":1}" and the Hubspot API can't successfully parse the content.

This PR passes the retried parameter into BaseClient._prepare_request() and skips the json.dumps() step for requests that are being retried.

@jpetrucciani
Copy link
Owner

Oh good catch! Thanks for the fix - I'll try to get a new release out today!

@jpetrucciani jpetrucciani merged commit 01d837a into jpetrucciani:master Aug 5, 2019
@jpetrucciani
Copy link
Owner

This is now live on pip as version3.2.22!

Thanks again for the fix! 😄

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

Successfully merging this pull request may close these issues.

2 participants