fix: Avoid errors with custom object ids in the list of object refs in the Report object
parent
ec1fbb58f6
commit
96946d956d
|
@ -477,7 +477,7 @@ class ReferenceProperty(Property):
|
||||||
if self.valid_types:
|
if self.valid_types:
|
||||||
ref_valid_types = enumerate_types(self.valid_types, 'v' + self.spec_version.replace(".", ""))
|
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 + '--'
|
required_prefix = possible_prefix + '--'
|
||||||
else:
|
else:
|
||||||
raise ValueError("The type-specifying prefix '%s' for this property is not valid" % (possible_prefix))
|
raise ValueError("The type-specifying prefix '%s' for this property is not valid" % (possible_prefix))
|
||||||
|
|
|
@ -250,6 +250,7 @@ class Report(STIXDomainObject):
|
||||||
])
|
])
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
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)
|
self._properties['object_refs'].contained.interoperability = kwargs.get('interoperability', False)
|
||||||
|
|
||||||
super(Report, self).__init__(*args, **kwargs)
|
super(Report, self).__init__(*args, **kwargs)
|
||||||
|
|
Loading…
Reference in New Issue