mirror of https://github.com/MISP/PyMISP
chg: Fix return of delete_event_report
parent
6969365d17
commit
03ebbbedce
|
@ -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 ###
|
||||
|
||||
|
|
Loading…
Reference in New Issue