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)