Преглед изворни кода

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 година
родитељ
комит
8299845615
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      netbox/netbox/authentication.py

+ 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)