Commit 448fa7e3 authored by Nicolas Dumazet's avatar Nicolas Dumazet

Allow calling this method from the web


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42975 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6389079a
......@@ -1410,7 +1410,7 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
self.erp5_site_global_id = global_id
security.declareProtected(Permissions.ManagePortal, 'migrateToPortalTypeClass')
def migrateToPortalTypeClass(self):
def migrateToPortalTypeClass(self, REQUEST=None):
"""Compatibility code that allows migrating a site to portal type classes.
We consider that a Site is migrated if its Types Tool is migrated
......@@ -1421,6 +1421,11 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
return
if types_tool.__class__.__module__ == 'erp5.portal_type':
# nothing to do, already migrated
if REQUEST is not None:
return REQUEST.RESPONSE.redirect(
'%s?portal_status_message=' \
'Nothing to do, already migrated.' % \
self.absolute_url())
return
# note that the site itself is not migrated (ERP5Site is not a portal type)
......@@ -1437,6 +1442,12 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
continue
method()
if REQUEST is not None:
return REQUEST.RESPONSE.redirect(
'%s?portal_status_message=' \
'Successfully migrated tools and types to portal type classes.' % \
self.absolute_url())
Globals.InitializeClass(ERP5Site)
def getBootstrapDirectory():
......
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