Merge pull request #660 from MISP/JakubOnderka-patch-1

fix: Path for event creating and editing
pull/663/head
Jakub Onderka 2020-11-16 17:23:17 +01:00 committed by GitHub
commit da5dbce6fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -324,7 +324,7 @@ class PyMISP:
:param pythonify: Returns a PyMISP Object instead of the plain json output
:param metadata: Return just event metadata after successful creating
"""
r = self._prepare_request('POST', 'events/add' + '/metadata:1' if metadata else '', data=event)
r = self._prepare_request('POST', 'events/add' + ('/metadata:1' if metadata else ''), data=event)
new_event = self._check_json_response(r)
if not (self.global_pythonify or pythonify) or 'errors' in new_event:
return new_event
@ -345,7 +345,7 @@ class PyMISP:
eid = get_uuid_or_id_from_abstract_misp(event)
else:
eid = get_uuid_or_id_from_abstract_misp(event_id)
r = self._prepare_request('POST', f'events/edit/{eid}' + '/metadata:1' if metadata else '', data=event)
r = self._prepare_request('POST', f'events/edit/{eid}' + ('/metadata:1' if metadata else ''), data=event)
updated_event = self._check_json_response(r)
if not (self.global_pythonify or pythonify) or 'errors' in updated_event:
return updated_event