Commit 7faf2774 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_erp5: In case of migration create Certificate Login instead ERP5 Login

parent 5412ed38
def migrateInstanceToERP5Login(self):
assert self.getPortalType() in ( 'Computer', 'Software Instance')
login_portal_type = 'ERP5 Login'
reference = self.getReference()
if not reference:
# no user id and no login is required
......@@ -9,12 +8,13 @@ def migrateInstanceToERP5Login(self):
if not (self.hasUserId() or self.getUserId() == reference):
self.setUserId(reference)
if len(self.objectValues(portal_type=login_portal_type)):
if len(self.objectValues(
portal_type=["Certificate Login", "ERP5 Login"])):
# already migrated
return
login = self.newContent(
portal_type=login_portal_type,
portal_type='Certificate Login',
reference=reference,
)
......
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