mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Fix label management in migration
This commit is contained in:
parent
64c950c1dc
commit
cfc782f015
1 changed files with 6 additions and 2 deletions
|
@ -37,6 +37,11 @@ class MyMigration(Migration):
|
||||||
ldap = _get_ldap_interface()
|
ldap = _get_ldap_interface()
|
||||||
permission_list = user_permission_list(short=True, full_path=False)["permissions"]
|
permission_list = user_permission_list(short=True, full_path=False)["permissions"]
|
||||||
|
|
||||||
|
labels = {}
|
||||||
|
for app in _installed_apps():
|
||||||
|
labels[app] = app_setting(app, 'label')
|
||||||
|
app_setting(app, 'label', delete=True)
|
||||||
|
|
||||||
for permission in permission_list:
|
for permission in permission_list:
|
||||||
if permission.split('.')[0] in SYSTEM_PERMS:
|
if permission.split('.')[0] in SYSTEM_PERMS:
|
||||||
ldap.update('cn=%s,ou=permission' % permission, {
|
ldap.update('cn=%s,ou=permission' % permission, {
|
||||||
|
@ -46,7 +51,7 @@ class MyMigration(Migration):
|
||||||
'isProtected': ["TRUE"],
|
'isProtected': ["TRUE"],
|
||||||
})
|
})
|
||||||
else:
|
else:
|
||||||
label = app_setting(permission.split('.')[0], 'label')
|
label = labels[permission.split('.')[0]]
|
||||||
|
|
||||||
if permission.endswith(".main"):
|
if permission.endswith(".main"):
|
||||||
ldap.update('cn=%s,ou=permission' % permission, {
|
ldap.update('cn=%s,ou=permission' % permission, {
|
||||||
|
@ -62,7 +67,6 @@ class MyMigration(Migration):
|
||||||
'showTile': ["FALSE"],
|
'showTile': ["FALSE"],
|
||||||
'isProtected': ["TRUE"]
|
'isProtected': ["TRUE"]
|
||||||
})
|
})
|
||||||
app_setting(permission.split('.')[0], 'label', delete=True)
|
|
||||||
|
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
|
Loading…
Add table
Reference in a new issue