mirror of https://github.com/MISP/PyMISP
fix: Do not modify default_attributes_parameters in MISPObject
parent
781161f82c
commit
c39328f30a
|
@ -1,6 +1,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from datetime import timezone, datetime, date
|
from datetime import timezone, datetime, date
|
||||||
|
import copy
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import base64
|
import base64
|
||||||
|
@ -603,7 +604,7 @@ class MISPObject(AbstractMISP):
|
||||||
'sharing_group_id', 'comment', 'first_seen', 'last_seen',
|
'sharing_group_id', 'comment', 'first_seen', 'last_seen',
|
||||||
'deleted'}
|
'deleted'}
|
||||||
|
|
||||||
def __init__(self, name: str, strict: bool = False, standalone: bool = True, default_attributes_parameters: dict = {}, **kwargs):
|
def __init__(self, name: str, strict: bool = False, standalone: bool = True, default_attributes_parameters: Dict = {}, **kwargs):
|
||||||
''' Master class representing a generic MISP object
|
''' Master class representing a generic MISP object
|
||||||
:name: Name of the object
|
:name: Name of the object
|
||||||
|
|
||||||
|
@ -637,7 +638,7 @@ class MISPObject(AbstractMISP):
|
||||||
# Just make sure we're not modifying an existing MISPAttribute
|
# Just make sure we're not modifying an existing MISPAttribute
|
||||||
self._default_attributes_parameters = default_attributes_parameters.to_dict()
|
self._default_attributes_parameters = default_attributes_parameters.to_dict()
|
||||||
else:
|
else:
|
||||||
self._default_attributes_parameters = default_attributes_parameters
|
self._default_attributes_parameters = copy.copy(default_attributes_parameters)
|
||||||
if self._default_attributes_parameters:
|
if self._default_attributes_parameters:
|
||||||
# Let's clean that up
|
# Let's clean that up
|
||||||
self._default_attributes_parameters.pop('value', None) # duh
|
self._default_attributes_parameters.pop('value', None) # duh
|
||||||
|
|
Loading…
Reference in New Issue