core: fix users's group list not allowing blank values

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-08-11 20:16:45 +02:00
parent 90426802fd
commit e0e0f4fa6c
1 changed files with 1 additions and 1 deletions

View File

@ -51,7 +51,7 @@ class UserSerializer(ModelSerializer):
avatar = CharField(read_only=True)
attributes = JSONField(validators=[is_dict], required=False)
groups = PrimaryKeyRelatedField(
allow_empty=False, many=True, source="ak_groups", queryset=Group.objects.all()
allow_empty=True, many=True, source="ak_groups", queryset=Group.objects.all()
)
groups_obj = ListSerializer(child=GroupSerializer(), read_only=True, source="ak_groups")
uid = CharField(read_only=True)