Skip to content

Commit 13a1114

Browse files
committed
refactor: enforce non-empty user lists in role serializers
1 parent 2b39c08 commit 13a1114

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

openedx_authz/rest_api/v1/serializers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ class PermissionValidationResponseSerializer(PermissionValidationSerializer): #
4242
class AddUserToRoleWithScopeSerializer(RoleMixin, ScopeMixin): # pylint: disable=abstract-method
4343
"""Serializer for adding a user to a role with a scope."""
4444

45-
users = serializers.ListField(child=serializers.CharField(max_length=255))
45+
users = serializers.ListField(child=serializers.CharField(max_length=255), allow_empty=False)
4646

4747

4848
class RemoveUserFromRoleWithScopeSerializer(RoleMixin, ScopeMixin): # pylint: disable=abstract-method
4949
"""Serializer for removing a user from a role with a scope."""
5050

51-
users = CommaSeparatedListField()
51+
users = CommaSeparatedListField(allow_blank=False)
5252

5353

5454
class ListUsersInRoleWithScopeSerializer(ScopeMixin): # pylint: disable=abstract-method

0 commit comments

Comments
 (0)