Commit 335648bd authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

patch: support unpickling UserPropertySheet instance that is pickled as old-style class.

this happens when a OAuth2 logged in user creates an activity on Zope2
then the system is upgraded to Zope4.
parent dc9ffa12
......@@ -109,3 +109,6 @@ from Products.ERP5Type.Core.Workflow import ValidationFailed
if WITH_LEGACY_WORKFLOW:
from Products.ERP5Type.patches.DCWorkflow import ERP5TransitionDefinition
from Products.ERP5Type.patches.BTreeFolder2 import ERP5BTreeFolder2Base
# For backward compatibility of old-style classes
from Products.ERP5Type.patches import UserPropertySheet
from Products.PluggableAuthService.UserPropertySheet import UserPropertySheet
if isinstance(UserPropertySheet, type): # new-stype class
# to unpickle instances that are picked as old-style class.
# this happens when a OAuth2 logged in user creates an activity on Zope2
# then the system is upgraded to Zope4.
__init__orig = UserPropertySheet.__init__
def __init__new(self, id=None, schema=None, **kw):
__init__orig(self, id, schema, **kw)
UserPropertySheet.__init__ = __init__new
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