MediaMath / t1-python

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

AttributeError: spend_cap_enabled #147

Closed wolfhund closed 7 years ago

wolfhund commented 7 years ago

Description

After obtaining a campaign, if I change the status and try to save it, the library responds with an AttributeError exception. After throwing this exception, the campaign updates its status to the new one.

Details OS: Mac OS Sierra 10.12.3 Python: 3.4.5 Package: TerminalOne==1.4.6

Example:

t1 = terminalone.T1(my_username, my_password, my_api_key)
campaign = t1.get("campaigns", campaign_id)
campaign.status = new_status
campaign.save()

Exception:

Traceback (most recent call last):
File "triggers/mediamath_integration.py", line 74, in _send_request
campaign.save()
File "/Users/carlos/.pyenv/versions/decidata/lib/python3.4/site-packages/terminalone/models/campaign.py", line 150, in save
super(Entity, self).__setattr__('_init_sce', self.spend_cap_enabled)
File "/Users/carlos/.pyenv/versions/decidata/lib/python3.4/site-packages/terminalone/entity.py", line 80, in __getattr__
raise AttributeError(attribute)
AttributeError: spend_cap_enabled
FodT commented 7 years ago

Hey @wolfhund, this was resolved by #112. Please upgrade t1-python to version 1.6.0 or greater.