mirror of https://github.com/MISP/PyMISP
fix: move __not_jsonable *inside* the __init__
Turns out, if you modify a variable defined outside the __init__, every instances (and inherited classes) of that class will be impacted by it.pull/434/head
parent
a3140f3773
commit
da6d7cbeb8
|
@ -82,12 +82,11 @@ class MISPEncode(JSONEncoder):
|
|||
|
||||
class AbstractMISP(MutableMapping):
|
||||
|
||||
__not_jsonable = []
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
"""Abstract class for all the MISP objects"""
|
||||
super(AbstractMISP, self).__init__()
|
||||
self.__edited = True # As we create a new object, we assume it is edited
|
||||
self.__not_jsonable = []
|
||||
|
||||
if kwargs.get('force_timestamps') is not None:
|
||||
# Ignore the edited objects and keep the timestamps.
|
||||
|
|
Loading…
Reference in New Issue