mirror of https://github.com/MISP/PyMISP
fix: index out of range in add_object
parent
3088998fbb
commit
977400b544
|
@ -1895,11 +1895,12 @@ class PyMISP(object):
|
||||||
# NOTE: this slightly fucked up thing is due to the fact template_id was required, and was the 2nd parameter.
|
# NOTE: this slightly fucked up thing is due to the fact template_id was required, and was the 2nd parameter.
|
||||||
template_id = kwargs.get('template_id')
|
template_id = kwargs.get('template_id')
|
||||||
misp_object = kwargs.get('misp_object')
|
misp_object = kwargs.get('misp_object')
|
||||||
if isinstance(args[0], MISPObject):
|
if args:
|
||||||
misp_object = args[0]
|
if isinstance(args[0], MISPObject):
|
||||||
else:
|
misp_object = args[0]
|
||||||
template_id = args[0]
|
else:
|
||||||
misp_object = args[1]
|
template_id = args[0]
|
||||||
|
misp_object = args[1]
|
||||||
|
|
||||||
if template_id is not None:
|
if template_id is not None:
|
||||||
url = urljoin(self.root_url, 'objects/add/{}/{}'.format(event_id, template_id))
|
url = urljoin(self.root_url, 'objects/add/{}/{}'.format(event_id, template_id))
|
||||||
|
|
Loading…
Reference in New Issue