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 append properties to deals request if that field is selected #102

Merged
merged 2 commits into from
Nov 7, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions tap_hubspot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,10 +485,12 @@ def sync_deals(STATE, ctx):
if (assoc_mdata.get('selected') and assoc_mdata.get('selected') == True):
params['includeAssociations'] = True

# Append all the properties fields for deals to the request
additional_properties = schema.get("properties").get("properties").get("properties")
for key in additional_properties.keys():
params['properties'].append(key)
# Append all the properties fields for deals to the request if
# properties is selectedOB
if mdata.get(('properties', 'properties'), {}).get('selected'):
additional_properties = schema.get("properties").get("properties").get("properties")
for key in additional_properties.keys():
params['properties'].append(key)

url = get_url('deals_all')
with Transformer(UNIX_MILLISECONDS_INTEGER_DATETIME_PARSING) as bumble_bee:
Expand Down