chg: Allow for old-style tag add

pull/49/head
Hannah Ward 2017-01-26 13:19:32 +00:00
parent a81f6b5c15
commit d355fc7e44
No known key found for this signature in database
GPG Key ID: 6F3BAD60DE190290
1 changed files with 3 additions and 0 deletions

View File

@ -373,6 +373,9 @@ class PyMISP(object):
to_post = {'request': {'Attribute': {'id': event['id'], 'tag': tag}}}
path = 'attributes/addTag'
else:
# Allow for backwards-compat with old style
if "Event" in event:
event = event["Event"]
to_post = {'request': {'Event': {'id': event['id'], 'tag': tag}}}
path = 'events/addTag'
response = session.post(urljoin(self.root_url, path), data=json.dumps(to_post))