mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-02 21:38:48 +00:00
- Significantly improves performance of users.models.update_group_roles() function - Ref: https://github.com/inventree/InvenTree/pull/5612 (cherry picked from commit 200bc5bd3d56ca2c1cd1a7cedab63e4cce0f5b5f) Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
This commit is contained in:
parent
978e08f3a3
commit
0b45d6f236
@ -373,7 +373,7 @@ def update_group_roles(group, debug=False):
|
|||||||
|
|
||||||
# Iterate through each permission already assigned to this group,
|
# Iterate through each permission already assigned to this group,
|
||||||
# and create a simplified permission key string
|
# and create a simplified permission key string
|
||||||
for p in group.permissions.all():
|
for p in group.permissions.all().prefetch_related('content_type'):
|
||||||
(permission, app, model) = p.natural_key()
|
(permission, app, model) = p.natural_key()
|
||||||
|
|
||||||
permission_string = '{app}.{perm}'.format(
|
permission_string = '{app}.{perm}'.format(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user