mirror of https://github.com/MISP/PyMISP
publish_timestamp Windows 7 Fix
On Windows 7 datetime.datetime.fromtimestamp(int(0)) returns a date before 1970, which causes the script to crash. This fixes the bug.pull/63/head
parent
a7e66ca5db
commit
4aa0df9d1f
|
@ -474,7 +474,7 @@ class MISPEvent(object):
|
|||
if kwargs.get('locked'):
|
||||
self.locked = kwargs['locked']
|
||||
if kwargs.get('publish_timestamp'):
|
||||
self.publish_timestamp = datetime.datetime.fromtimestamp(int(kwargs['publish_timestamp']))
|
||||
self.publish_timestamp = datetime.datetime(1970, 1, 1) + datetime.timedelta(seconds=int(kwargs['publish_timestamp']))
|
||||
if kwargs.get('sharing_group_id'):
|
||||
self.sharing_group_id = int(kwargs['sharing_group_id'])
|
||||
if kwargs.get('Org'):
|
||||
|
|
Loading…
Reference in New Issue