DEV Community

Vicente G. Reyes
Vicente G. Reyes

Posted on

Extra field in custom registration in DRF won't save

I created a custom serializer that extends dj_rest_auth's RegisterSerializer, added the extra user_type field, overrode the get_cleaned_data method to include the user_type in the cleaned data then configured the custom registration serializer used for registration.

Here's my code:

class CustomRegisterSerializer(RegisterSerializer)
    user_type = serializers.ChoiceField(choices=[('seeker', 'Seeker'), ('recruiter', 'Recruiter')])

    class Meta:
        model

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay