chg: Do not get the event from the server before publishing if PyMISP.publish gets an ID

pull/146/head
Raphaël Vinot 2017-12-01 16:47:06 +01:00
parent f4439ae970
commit be65733d73
1 changed files with 4 additions and 4 deletions

View File

@ -416,12 +416,12 @@ class PyMISP(object):
:return publish status
"""
if isinstance(event, int) or (isinstance(event, basestring) and event.isdigit()):
full_event = self._make_mispevent(self.get_event(event))
event_id = event
else:
full_event = self._make_mispevent(event)
event_id = full_event.id
if full_event.published:
return {'error': 'Already published'}
event_id = full_event.id
return self.fast_publish(event_id, alert)
def change_threat_level(self, event, threat_level_id):