From b9718c3fd389f13cc441835e10256cc760117719 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Thu, 4 Jan 2018 12:23:32 +0100 Subject: [PATCH] fix: Don't remove the distribution and sharing_group_id from default_attributes_parameters --- pymisp/mispevent.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pymisp/mispevent.py b/pymisp/mispevent.py index 3885b64..5462a8f 100644 --- a/pymisp/mispevent.py +++ b/pymisp/mispevent.py @@ -791,11 +791,13 @@ class MISPObject(AbstractMISP): self._default_attributes_parameters.pop('to_ids', None) # depends on the value self._default_attributes_parameters.pop('deleted', None) # doesn't make sense to pre-set it self._default_attributes_parameters.pop('data', None) # in case the original in a sample or an attachment - self.distribution = self._default_attributes_parameters.pop('distribution', 5) - self.sharing_group_id = self._default_attributes_parameters.pop('sharing_group_id', 0) + + # Those values are set for the current object, if they exist, but not pop'd because they are still useful for the attributes + self.distribution = self._default_attributes_parameters.get('distribution', 5) + self.sharing_group_id = self._default_attributes_parameters.get('sharing_group_id', 0) else: self.distribution = 5 # Default to inherit - self.sharing_group_id = None + self.sharing_group_id = 0 self._standalone = standalone if self._standalone: # Mark as non_jsonable because we need to add the references manually after the object(s) have been created