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

Prevent duplicated querystring parameters when getting batches of contacts #52

Conversation

sangaline
Copy link
Contributor

The ContactsClient.get_batch() method was mutating the ContactsClient.default_batch_properties when adding in the extra_properties. This resulted in a situation where subsequent calls to ContactsClient.get_batch() would cause property=X to be repeated once for each time it had been included previously. This eventually leads to a bad request error from Hubspot once the URI gets too long.

This PR stops the ContactsClient.default_batch_properties mutation from happening, and uses a set instead of a list so that there won't be duplicate properties in the query string even if they appear in both extra_properties and ContactsClient.default_batch_properties.

@jpetrucciani
Copy link
Owner

Another good catch! I'll get this merged and released soon.

@jpetrucciani jpetrucciani merged commit 8f8b811 into jpetrucciani:master Aug 6, 2019
@jpetrucciani
Copy link
Owner

This is now live on pip as version 3.2.23!

Thanks again for this 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.

None yet

2 participants