mirror of https://github.com/MISP/PyMISP
chg: Validate attributes in attributes.setter
parent
749acd70b5
commit
b745fce446
|
@ -586,7 +586,10 @@ class MISPEvent(AbstractMISP):
|
||||||
|
|
||||||
@attributes.setter
|
@attributes.setter
|
||||||
def attributes(self, attributes):
|
def attributes(self, attributes):
|
||||||
|
if all(isinstance(x, MISPAttribute) for x in attributes):
|
||||||
self.Attribute = attributes
|
self.Attribute = attributes
|
||||||
|
else:
|
||||||
|
raise PyMISPError('All the attributes have to be of type MISPAttribute.')
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def related_events(self):
|
def related_events(self):
|
||||||
|
|
Loading…
Reference in New Issue