2
0
Эх сурвалжийг харах

Merge pull request #7676 from kkthxbye-code/develop

Fix #7399: LDAP excessive CPU usage when AUTH_LDAP_FIND_GROUP_PERMS is enabled
Jeremy Stretch 4 жил өмнө
parent
commit
8299845615

+ 1 - 1
netbox/netbox/authentication.py

@@ -34,7 +34,7 @@ class ObjectPermissionMixin():
         object_permissions = ObjectPermission.objects.filter(
             self.get_permission_filter(user_obj),
             enabled=True
-        ).prefetch_related('object_types')
+        ).order_by('id').distinct('id').prefetch_related('object_types')
 
         # Create a dictionary mapping permissions to their constraints
         perms = defaultdict(list)