chg: Fix return of delete_event_report

pull/700/head
Raphaël Vinot 2021-01-28 14:48:23 +01:00
parent 78402394e5
commit c5218c1ce2
1 changed files with 2 additions and 8 deletions

View File

@ -486,7 +486,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
@ -497,13 +497,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 ###