Commit 9e0cc53d authored by Julien Muchembled's avatar Julien Muchembled

Fix use of persistent instances of ERP5 Base outside of portal

This fixes testSelectionTool.TestSelectionPersistence.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@45080 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d3b581fb
...@@ -176,7 +176,10 @@ if 1: ...@@ -176,7 +176,10 @@ if 1:
if portal_type == 'Dummy Class Tool': if portal_type == 'Dummy Class Tool':
return Base__setstate__(self, value) return Base__setstate__(self, value)
# proceed with migration # proceed with migration
self._fixPortalTypeBeforeMigration(portal_type) try:
self._fixPortalTypeBeforeMigration(portal_type)
except IndexError: # getSite raised
return Base__setstate__(self, value)
import erp5.portal_type import erp5.portal_type
newklass = getattr(erp5.portal_type, portal_type) newklass = getattr(erp5.portal_type, portal_type)
assert self.__class__ is not newklass assert self.__class__ is not newklass
......
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