mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Merge pull request #1107 from eeintech/fix_postgres_migration
Fix PostGreSQL migration (permissions handler)
This commit is contained in:
commit
826c471179
@ -316,7 +316,8 @@ def update_group_roles(group, debug=False):
|
|||||||
|
|
||||||
permission = get_permission_object(perm)
|
permission = get_permission_object(perm)
|
||||||
|
|
||||||
group.permissions.add(permission)
|
if permission:
|
||||||
|
group.permissions.add(permission)
|
||||||
|
|
||||||
if debug:
|
if debug:
|
||||||
print(f"Adding permission {perm} to group {group.name}")
|
print(f"Adding permission {perm} to group {group.name}")
|
||||||
@ -330,7 +331,8 @@ def update_group_roles(group, debug=False):
|
|||||||
|
|
||||||
permission = get_permission_object(perm)
|
permission = get_permission_object(perm)
|
||||||
|
|
||||||
group.permissions.remove(permission)
|
if permission:
|
||||||
|
group.permissions.remove(permission)
|
||||||
|
|
||||||
if debug:
|
if debug:
|
||||||
print(f"Removing permission {perm} from group {group.name}")
|
print(f"Removing permission {perm} from group {group.name}")
|
||||||
|
Loading…
Reference in New Issue
Block a user