|
|
@ -314,6 +314,11 @@ class VariableClMigrateData(UserHelper, TableVariable):
|
|
|
|
self.label = _("Migrating users")
|
|
|
|
self.label = _("Migrating users")
|
|
|
|
|
|
|
|
|
|
|
|
def set(self, value):
|
|
|
|
def set(self, value):
|
|
|
|
|
|
|
|
value = [
|
|
|
|
|
|
|
|
[x[0], {'none':''}.get(x[1],x[1]),
|
|
|
|
|
|
|
|
x[2],x[3]]
|
|
|
|
|
|
|
|
for x in value
|
|
|
|
|
|
|
|
]
|
|
|
|
if len(value) == 1:
|
|
|
|
if len(value) == 1:
|
|
|
|
if len(value[0]) > 1 and value[0][0] == 'none':
|
|
|
|
if len(value[0]) > 1 and value[0][0] == 'none':
|
|
|
|
return [[]]
|
|
|
|
return [[]]
|
|
|
@ -359,6 +364,7 @@ class VariableClMigrateAdmin(UserHelper, Variable):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
type = 'choice-list'
|
|
|
|
type = 'choice-list'
|
|
|
|
default_value = ""
|
|
|
|
default_value = ""
|
|
|
|
|
|
|
|
aliases = {'system_update': 'update'}
|
|
|
|
|
|
|
|
|
|
|
|
def init(self):
|
|
|
|
def init(self):
|
|
|
|
self.label = _("Administrator")
|
|
|
|
self.label = _("Administrator")
|
|
|
@ -370,17 +376,18 @@ class VariableClMigrateAdmin(UserHelper, Variable):
|
|
|
|
("update", _("System update")),
|
|
|
|
("update", _("System update")),
|
|
|
|
]
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_alias(self, value):
|
|
|
|
|
|
|
|
return self.aliases.get(value, value)
|
|
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
def get(self):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
Migrating users (users above 1000 uid)
|
|
|
|
Migrating users (users above 1000 uid)
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
admins = Admins(self.parent)
|
|
|
|
admins = Admins(self.parent)
|
|
|
|
return [admins[x] or self.default_value
|
|
|
|
return [self.get_alias(admins[x]) or self.default_value
|
|
|
|
for x in self.Get('cl_migrate_user')]
|
|
|
|
for x in self.Get('cl_migrate_user')]
|
|
|
|
|
|
|
|
|
|
|
|
def set(self, value):
|
|
|
|
def set(self, value):
|
|
|
|
name_map = {'update':'system_update', 'none':''}
|
|
|
|
|
|
|
|
value = map(lambda x:name_map.get(x,x), value)
|
|
|
|
|
|
|
|
return map(lambda x: x if x else self.default_value, value)
|
|
|
|
return map(lambda x: x if x else self.default_value, value)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|