Skip to content

Commit

Permalink
fix: skip unallowed common properties provided by object factory
Browse files Browse the repository at this point in the history
  • Loading branch information
SYNchroACK committed Oct 15, 2024
1 parent 68ba448 commit beb0854
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions stix2/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ def create(self, cls, **kwargs):
# Use self.defaults as the base, but update with any explicit args
# provided by the user.
properties = copy.deepcopy(self._defaults)

# SCOs do not have these common properties provided by the factory
if "observables" in cls.__module__:
properties.pop("created", None)
properties.pop("created_by_ref", None)
properties.pop("external_references", None)

if kwargs:
if self._list_append:
# Append provided items to list properties instead of replacing them
Expand Down

0 comments on commit beb0854

Please sign in to comment.