Преглед на файлове

Fix #7399 - LDAP using excessive CPU when AUTH_LDAP_FIND_GROUP_PERMS is enabled

kkthxbye-code преди 4 години
родител
ревизия
830cf4b31f
променени са 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)