-
Notifications
You must be signed in to change notification settings - Fork 28
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
Getting the safety child of strategy fails after saving a safety #57
Comments
So here is the problem—it's not consistent. For instance: >>> td
TargetDimension(_type='target_dimension', parent='strategies', incldue=[], parent_id=683880, exclude=[], include=[TargetValue(_type='target_value', code='Laptop/Desktop', name='Laptop/Desktop', is_targetable=True, value=43000, target_dimension_id=24, id=301523)], id=24)
>>> td.include = []
>>> td.save()
>>> td.add(td.include, 301523)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/pswaminathan/.virtualenvs/t1pyprod/lib/python2.7/site-packages/terminalone/models/targetdimension.py", line 79, in add
'/'.join(url))
File "/Users/pswaminathan/.virtualenvs/t1pyprod/lib/python2.7/site-packages/terminalone/connection.py", line 80, in _get
raise ClientError('Could not parse XML response: {!r}'.format(exc))
terminalone.errors.ClientError: "Could not parse XML response: ParseError('no element found: line 1, column 0',)"
>>> td.add(td.include, 301523)
>>> td.save()
>>> td.include = []
>>> td.save()
>>> td.add(td.include, 301523)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/pswaminathan/.virtualenvs/t1pyprod/lib/python2.7/site-packages/terminalone/models/targetdimension.py", line 79, in add
'/'.join(url))
File "/Users/pswaminathan/.virtualenvs/t1pyprod/lib/python2.7/site-packages/terminalone/connection.py", line 80, in _get
raise ClientError('Could not parse XML response: {!r}'.format(exc))
terminalone.errors.ClientError: "Could not parse XML response: ParseError('no element found: line 1, column 0',)"
>>> td.response.request.headers
{'Connection': 'keep-alive', 'Cookie': 'adama_session=e8f8dfee49aaa36c908439d51dff09f4d8547d55', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'User-Agent': 't1-python/1.0.4 python-requests/2.8.0'}
>>> td.response.request.url
'https://api.mediamath.com/api/v2.0/target_values/301523?api_key=removed'
>>> td.response.headers
{'Content-Length': '0', 'Connection': 'keep-alive', 'Server': 'Jetty(8.1.3.v20120522)'}
>>> td.response.status_code
400
>>> td.response.content
'' Here, it breaks on the first include, then works, then breaks again the next time. I've also had it break on save. I've also had it never break on the include. We're looking into this. But it's not straightforward. |
Note that this also affects @amnoonan |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you run the below code in interpreter:
the last get will output following traceback:
The text was updated successfully, but these errors were encountered: