Commit edc26452 authored by Jim Fulton's avatar Jim Fulton

Fixed some code for registering class changes to avoid the

registration of data managers that are None.  This code will,
eventually, go away, since new persistent classes will
take care of their own registration.
parent d7677f0f
......@@ -23,13 +23,13 @@ class ClassCaretaker:
def __setattr__(self, name, v):
klass=self._k
setattr(klass, name, v)
if not getattr(klass,'_p_changed',None):
if not getattr(klass,'_p_changed',None) and klass._p_jar is not None:
get_transaction().register(klass)
klass._p_changed=1
def __delattr__(self, name):
klass=self._k
delattr(klass, name)
if not getattr(klass,'_p_changed',None):
if not getattr(klass,'_p_changed',None) and klass._p_jar is not None:
get_transaction().register(klass)
klass._p_changed=1
......@@ -270,7 +270,7 @@ class ZInstanceSheet(OFS.PropertySheets.FixedSchema,
Globals.default__class_init__(ZInstanceSheet)
def rclass(klass):
if not getattr(klass, '_p_changed', 0):
if not getattr(klass, '_p_changed', 0) and klass._p_jar is not None:
get_transaction().register(klass)
klass._p_changed=1
......
......@@ -519,7 +519,7 @@ class ZClass( Base
def setClassAttr(self, name, value):
c=self._zclass_
setattr(c, name, value)
if not c._p_changed:
if (not c._p_changed) and (c._p_jar is not None):
get_transaction().register(c)
c._p_changed=1
......@@ -527,7 +527,7 @@ class ZClass( Base
def delClassAttr(self, name):
c=self._zclass_
delattr(c, name)
if not c._p_changed:
if (not c._p_changed) and (c._p_jar is not None):
get_transaction().register(c)
c._p_changed=1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment