# HG changeset patch # User Marcin Kuzminski # Date 2012-02-07 05:32:16 # Node ID 367d76f5fcf561d0477ab2f6b76afef363189884 # Parent 40f04021fa61d8b2fc8ae6365d64428dc5d1bf0c added re-creation of permissions into step4 upgrade diff --git a/rhodecode/lib/db_manage.py b/rhodecode/lib/db_manage.py --- a/rhodecode/lib/db_manage.py +++ b/rhodecode/lib/db_manage.py @@ -172,6 +172,7 @@ class DbManage(object): def step_4(self): print ('TODO:') + self.create_permissions() self.klass.fixup_groups() upgrade_steps = [0] + range(curr_version + 1, __dbversion__ + 1) @@ -483,10 +484,11 @@ class DbManage(object): ] for p in perms: - new_perm = Permission() - new_perm.permission_name = p[0] - new_perm.permission_longname = p[1] - self.sa.add(new_perm) + if not Permission.get_by_key(p): + new_perm = Permission() + new_perm.permission_name = p[0] + new_perm.permission_longname = p[1] + self.sa.add(new_perm) def populate_default_permissions(self): log.info('creating default user permissions')