mirror of https://github.com/MISP/PyMISP
chg: Fix return of delete_event_report
parent
78402394e5
commit
c5218c1ce2
|
@ -486,7 +486,7 @@ class PyMISP:
|
||||||
er.from_dict(**updated_event_report)
|
er.from_dict(**updated_event_report)
|
||||||
return er
|
return er
|
||||||
|
|
||||||
def delete_event_report(self, event_report: Union[MISPEventReport, int, str, UUID], hard: bool = False, pythonify: bool = False) -> Dict:
|
def delete_event_report(self, event_report: Union[MISPEventReport, int, str, UUID], hard: bool = False) -> Dict:
|
||||||
"""Delete an event report from a MISP instance
|
"""Delete an event report from a MISP instance
|
||||||
|
|
||||||
:param event_report: event report to delete
|
:param event_report: event report to delete
|
||||||
|
@ -497,13 +497,7 @@ class PyMISP:
|
||||||
if hard:
|
if hard:
|
||||||
request_url += "/1"
|
request_url += "/1"
|
||||||
r = self._prepare_request('POST', request_url)
|
r = self._prepare_request('POST', request_url)
|
||||||
response = self._check_json_response(r)
|
return self._check_json_response(r)
|
||||||
if not (self.global_pythonify or pythonify) or 'errors' in response or hard:
|
|
||||||
# Hard will permanently delete, must return JSON
|
|
||||||
return response
|
|
||||||
er = MISPEventReport()
|
|
||||||
er.from_dict(**response)
|
|
||||||
return er
|
|
||||||
|
|
||||||
# ## END Event Report ###
|
# ## END Event Report ###
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue