Skip to content

Commit 830cf4b

Browse files
committed
Fix #7399 - LDAP using excessive CPU when AUTH_LDAP_FIND_GROUP_PERMS is enabled
1 parent f5356b8 commit 830cf4b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

netbox/netbox/authentication.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def get_object_permissions(self, user_obj):
3434
object_permissions = ObjectPermission.objects.filter(
3535
self.get_permission_filter(user_obj),
3636
enabled=True
37-
).prefetch_related('object_types')
37+
).order_by('id').distinct('id').prefetch_related('object_types')
3838

3939
# Create a dictionary mapping permissions to their constraints
4040
perms = defaultdict(list)

0 commit comments

Comments
 (0)