fix: Avoid errors with custom object ids in the list of object refs in the Report object

master
chrisr3d 2020-01-17 17:13:43 +01:00
parent ec1fbb58f6
commit 96946d956d
No known key found for this signature in database
GPG Key ID: 6BBED1B63A6D639F
2 changed files with 2 additions and 1 deletions

View File

@ -477,7 +477,7 @@ class ReferenceProperty(Property):
if self.valid_types:
ref_valid_types = enumerate_types(self.valid_types, 'v' + self.spec_version.replace(".", ""))
if possible_prefix in ref_valid_types:
if possible_prefix in ref_valid_types or self.allow_custom:
required_prefix = possible_prefix + '--'
else:
raise ValueError("The type-specifying prefix '%s' for this property is not valid" % (possible_prefix))

View File

@ -250,6 +250,7 @@ class Report(STIXDomainObject):
])
def __init__(self, *args, **kwargs):
self._properties['object_refs'].contained.allow_custom = kwargs.get('allow_custom', False)
self._properties['object_refs'].contained.interoperability = kwargs.get('interoperability', False)
super(Report, self).__init__(*args, **kwargs)