Skip to content

Commit

Permalink
fix: Initialize default class parameters.
Browse files Browse the repository at this point in the history
Fix #155
  • Loading branch information
Rafiot committed Dec 19, 2017
1 parent 0fa7785 commit 74640af
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pymisp/mispevent.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,9 @@ def __init__(self, describe_types=None, strict_validation=False):

self._types = describe_types['types']
self.Tag = []
self.Attribute = []
self.Object = []
self.RelatedEvent = []

def _reinitialize_event(self):
# Default values for a valid event to send to a MISP instance
Expand Down Expand Up @@ -445,7 +448,7 @@ def set_all_values(self, **kwargs):

def __repr__(self):
if hasattr(self, 'info'):
return '<{self.__class__.__name__}(info={self.info}, date={self.date})'.format(self=self)
return '<{self.__class__.__name__}(info={self.info})'.format(self=self)
return '<{self.__class__.__name__}(NotInitialized)'.format(self=self)

def from_dict(self, **kwargs):
Expand Down

0 comments on commit 74640af

Please sign in to comment.