chg: Fix return of delete_event_report

pull/694/head
Raphaël Vinot 2021-01-28 14:48:23 +01:00
parent 6969365d17
commit 03ebbbedce
1 changed files with 2 additions and 8 deletions

View File

@ -462,7 +462,7 @@ class PyMISP:
er.from_dict(**updated_event_report)
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
:param event_report: event report to delete
@ -473,13 +473,7 @@ class PyMISP:
if hard:
request_url += "/1"
r = self._prepare_request('POST', request_url)
response = 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
return self._check_json_response(r)
# ## END Event Report ###