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' assert self.getPortalType() == 'Person'
reference = self.getReference() reference = self.getReference()
if not reference: if not reference:
...@@ -6,7 +6,7 @@ def migrateToERP5Login(self): ...@@ -6,7 +6,7 @@ def migrateToERP5Login(self):
return return
if not self.hasUserId() or self.getUserId() == reference: if not self.hasUserId() or self.getUserId() == reference:
self._baseSetUserId(reference) self._baseSetUserId(reference)
self.reindexObject() self.reindexObject(activate_kw={'tag': tag})
if not self.hasPassword(): if not self.hasPassword():
# no login is required, but possibly another Login type object is required if implemented # no login is required, but possibly another Login type object is required if implemented
return return
...@@ -16,6 +16,7 @@ def migrateToERP5Login(self): ...@@ -16,6 +16,7 @@ def migrateToERP5Login(self):
login = self.newContent( login = self.newContent(
portal_type='ERP5 Login', portal_type='ERP5 Login',
reference=reference, reference=reference,
activate_kw={'tag': tag},
) )
login._setEncodedPassword(self.getPassword()) login._setEncodedPassword(self.getPassword())
login.validate() login.validate()
......
...@@ -10,6 +10,7 @@ if plugin_id in acl_users.plugins.getAllPlugins(plugin_type='IAuthenticationPlug ...@@ -10,6 +10,7 @@ if plugin_id in acl_users.plugins.getAllPlugins(plugin_type='IAuthenticationPlug
portal_type='Person', portal_type='Person',
activate_kw={'tag': tag, 'priority': 6}, activate_kw={'tag': tag, 'priority': 6},
method_id='Person_migrateToERP5Login', method_id='Person_migrateToERP5Login',
method_kw={'tag': tag},
) )
portal.portal_activities.activate(after_tag=tag).ERP5Site_disableERP5UserManager() portal.portal_activities.activate(after_tag=tag).ERP5Site_disableERP5UserManager()
return error_list 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