fix: Don't auto-publish events

pull/51/head
Hannah Ward 2017-02-06 11:06:37 +00:00
parent a4f90a7ac1
commit 98a008e67a
No known key found for this signature in database
GPG Key ID: 6F3BAD60DE190290
1 changed files with 2 additions and 0 deletions

View File

@ -440,6 +440,8 @@ class MISPEvent(object):
if self.analysis not in [0, 1, 2]: if self.analysis not in [0, 1, 2]:
raise NewEventError('{} is invalid, the analysis has to be in 0, 1, 2'.format(self.analysis)) raise NewEventError('{} is invalid, the analysis has to be in 0, 1, 2'.format(self.analysis))
if kwargs.get('published') is not None: if kwargs.get('published') is not None:
self.unpublish()
if kwargs.get("published") == True:
self.publish() self.publish()
if kwargs.get('date'): if kwargs.get('date'):
self.set_date(kwargs['date']) self.set_date(kwargs['date'])