Fix: exclude admin perms from group permissions serializer (#6608)

This commit is contained in:
shamoon 2024-05-07 07:39:31 -07:00 committed by GitHub
parent fda4742e86
commit 0d49314593
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -93,7 +93,7 @@ class UserSerializer(serializers.ModelSerializer):
class GroupSerializer(serializers.ModelSerializer):
permissions = serializers.SlugRelatedField(
many=True,
queryset=Permission.objects.all(),
queryset=Permission.objects.exclude(content_type__app_label="admin"),
slug_field="codename",
)