Skip to content

SerializerMutation don't excluded write_only fields #487

Closed
@vladimirmyshkovski

Description

@vladimirmyshkovski
class UserSerializer(ModelSerializer):

    class Meta:
        model = User
        fields = ['username', 'name', 'first_name', 'last_name', 'email', 'password']
        read_only_fields = ['username']
        extra_kwargs = {'password': {'write_only': True}}


class UserSerializerMutation(SerializerMutation):

    class Meta:
        lookup_field = 'username'
        serializer_class = UserSerializer

It is expected that the password will not be possible to get as a result.

4df0b71d-13b8-4a61-8b0f-1a6b334b4738

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions