python-intercom icon indicating copy to clipboard operation
python-intercom copied to clipboard

using .update on the custom_attributes with a False value, that update is skipped upon save

Open davidemerritt opened this issue 7 years ago • 0 comments

attributes_dict = {'is_active': False}

This code failed to update on save with a False value within the dictionary.

user = intercom_client.users.find(email=user_email)
user.custom_attributes.update(attributes_dict)
intercom_client.users.save(user)

while this did work

user = intercom_client.users.find(email=user_email)
user.custom_attributes.update(attributes_dict)
for key, val in attributes_dict.iteritems():
  user.custom_attributes[key] = val
intercom_client.users.save(user)

davidemerritt avatar Apr 12 '18 22:04 davidemerritt