Commit cbb861b7 authored by Vincent Pelletier's avatar Vincent Pelletier

TemplateTool_checkERP5UserManagerNonExistenceConsistency: Add missing activity dependency.

Person and ERP5 Login documents must be indexed before
ERP5Site_disableERP5UserManager may run, so set the migration tag on these
indexation activities.
parent 4aea3dd3
def migrateToERP5Login(self):
def migrateToERP5Login(self, tag=None):
assert self.getPortalType() == 'Person'
reference = self.getReference()
if not reference:
......@@ -6,7 +6,7 @@ def migrateToERP5Login(self):
return
if not self.hasUserId() or self.getUserId() == reference:
self._baseSetUserId(reference)
self.reindexObject()
self.reindexObject(activate_kw={'tag': tag})
if not self.hasPassword():
# no login is required, but possibly another Login type object is required if implemented
return
......@@ -16,6 +16,7 @@ def migrateToERP5Login(self):
login = self.newContent(
portal_type='ERP5 Login',
reference=reference,
activate_kw={'tag': tag},
)
login._setEncodedPassword(self.getPassword())
login.validate()
......
......@@ -10,6 +10,7 @@ if plugin_id in acl_users.plugins.getAllPlugins(plugin_type='IAuthenticationPlug
portal_type='Person',
activate_kw={'tag': tag, 'priority': 6},
method_id='Person_migrateToERP5Login',
method_kw={'tag': tag},
)
portal.portal_activities.activate(after_tag=tag).ERP5Site_disableERP5UserManager()
return error_list
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