Skip to content

Commit

Permalink
fix: Avoid errors with custom object ids in the list of object refs i…
Browse files Browse the repository at this point in the history
…n the Report object
  • Loading branch information
chrisr3d committed Jan 17, 2020
1 parent ec1fbb5 commit 96946d9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion stix2/properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ def clean(self, value):
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))
Expand Down
1 change: 1 addition & 0 deletions stix2/v20/sdo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 96946d9

Please sign in to comment.