Commit e054a90e authored by Nicolas Dumazet's avatar Nicolas Dumazet

hardcode the meta_type of Types Tool to be able to add it very early, when

bootstrapping an instance.

If we don't dont this, the portal._setObject('portal_types', ...) call while
creating a new site will fail because it will force unghosting the portal
type class of "Types Tool", which is not possible this types tool is not
installed yet.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42441 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6703954d
...@@ -50,6 +50,13 @@ class GhostBaseMetaClass(ExtensionClass): ...@@ -50,6 +50,13 @@ class GhostBaseMetaClass(ExtensionClass):
Because __bases__ is changed, the behavior of this object Because __bases__ is changed, the behavior of this object
will change after the first call. will change after the first call.
""" """
# very special case used to bootstrap an instance:
# calling _setObject() requires accessing the meta_type of the
# object we're setting, but when creating portal_types it's way
# too early to load erp5.portal_type.Types Tool
if attr == "meta_type" and self.__class__.__name__ == "Types Tool":
return "ERP5 Types Tool"
# Class must be loaded if '__of__' is requested because otherwise, # Class must be loaded if '__of__' is requested because otherwise,
# next call to __getattribute__ would lose any acquisition wrapper. # next call to __getattribute__ would lose any acquisition wrapper.
if attr in ('__class__', if attr in ('__class__',
......
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