MediaMath / t1-python

Python SDK for MediaMath Platform APIs
https://developer.mediamath.com/
Apache License 2.0
18 stars 30 forks source link

fix initialising of _init values #100

Closed FodT closed 7 years ago

FodT commented 7 years ago

_init_sce in Campaign objects was being set before the Entity constructor parsed the spend_cap_enabled property from an integer to a boolean. This was causing a failed comparison in the first case of the _migration_asst() comparison when nothing had changed, as _init_sce was a string being compared to a Boolean.

The net result being that pulling a campaign, changing some unrelated fields and then saving() was causing spend_cap_type to be removed from the POST body instead of both fields. Then Adama's API steps in when it doesn't see the new field and substitutes a default value.

This also applied to Strategies. Fixed by moving super() call up to before these fields are grabbed.