Skip to content

Commit fdb36c9

Browse files
committed
fix: skip unallowed common properties provided by object factory
1 parent 64ab3fc commit fdb36c9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

stix2/environment.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ def create(self, cls, **kwargs):
8383
# Use self.defaults as the base, but update with any explicit args
8484
# provided by the user.
8585
properties = copy.deepcopy(self._defaults)
86+
87+
# SCOs do not have these common properties provided by the factory
88+
if "observables" in cls.__module__:
89+
properties.pop("created", None)
90+
properties.pop("created_by_ref", None)
91+
properties.pop("external_references", None)
92+
8693
if kwargs:
8794
if self._list_append:
8895
# Append provided items to list properties instead of replacing them

0 commit comments

Comments
 (0)