Hi folks, just looking for some help. I'm trying to setup custom validation with Djoser auth for user creation. I just want to add a check in the validation method for email, and raise an exception if exists().
Pretty simple, followed Djoser docs, but when calling /users/ endpoint from frontend, it always users the default serializer,
Settings.
'SERIALIZERS': { 'user_create': 'core.serializers.CustomUserCreateSerializer',}
Serializers
`class CustomUserCreateSerializer(UserCreateSerializer):
class Meta(UserCreateSerializer.Meta):
model = User
fields = ('id', 'email', 'username', 'password')
def validate(self, attrs):
super().validate(attrs)
#custom validation here`