Merge branch 'dragsu-feat-galaxy-copying'

pull/1025/head
Raphaël Vinot 2023-07-06 19:10:02 +02:00
commit 0dc8f428b3
1 changed files with 7 additions and 0 deletions

View File

@ -1721,6 +1721,13 @@ class MISPEvent(AbstractMISP):
def galaxies(self) -> List[MISPGalaxy]:
return self.Galaxy
@galaxies.setter
def galaxies(self, galaxies: List[MISPGalaxy]):
if all(isinstance(x, MISPGalaxy) for x in galaxies):
self.Galaxy = galaxies
else:
raise PyMISPError('All the attributes have to be of type MISPGalaxy.')
@property
def objects(self) -> List[MISPObject]:
return self.Object