from django.contrib.auth.validators import UnicodeUsernameValidator
from rest_framework import serializers

from auth0.models import CustomUser


class UserSerializer(serializers.ModelSerializer):
    class Meta:
        model = CustomUser
        fields = ('id', 'username', 'email', 'nickname')
        extra_kwargs = {
            'username': {
                'validators': [UnicodeUsernameValidator()],
            }
        }

    def update(self, instance, validated_data):
        instance.nickname = validated_data.get('nickname', instance.nickname)
        instance.email = validated_data.get('email', instance.email)
        instance.save()
        return instance

55cb2c3fd24f3204424f936e953121df1e2134b0
<mask token>

<mask token>


class UserSerializer(serializers.ModelSerializer):


    class Meta:
        model = CustomUser
        fields = 'id', 'username', 'email', 'nickname'
        extra_kwargs = {'username': {'validators': [
            UnicodeUsernameValidator()]}}
    <mask token>

<mask token>


class UserSerializer(serializers.ModelSerializer):


    class Meta:
        model = CustomUser
        fields = 'id', 'username', 'email', 'nickname'
        extra_kwargs = {'username': {'validators': [
            UnicodeUsernameValidator()]}}

    def update(self, instance, validated_data):
        instance.nickname = validated_data.get('nickname', instance.nickname)
        instance.email = validated_data.get('email', instance.email)
        instance.save()
        return instance

from django.contrib.auth.validators import UnicodeUsernameValidator
from rest_framework import serializers
from auth0.models import CustomUser


class UserSerializer(serializers.ModelSerializer):


    class Meta:
        model = CustomUser
        fields = 'id', 'username', 'email', 'nickname'
        extra_kwargs = {'username': {'validators': [
            UnicodeUsernameValidator()]}}

    def update(self, instance, validated_data):
        instance.nickname = validated_data.get('nickname', instance.nickname)
        instance.email = validated_data.get('email', instance.email)
        instance.save()
        return instance

from django.contrib.auth.validators import UnicodeUsernameValidator
from rest_framework import serializers

from auth0.models import CustomUser


class UserSerializer(serializers.ModelSerializer):
    class Meta:
        model = CustomUser
        fields = ('id', 'username', 'email', 'nickname')
        extra_kwargs = {
            'username': {
                'validators': [UnicodeUsernameValidator()],
            }
        }

    def update(self, instance, validated_data):
        instance.nickname = validated_data.get('nickname', instance.nickname)
        instance.email = validated_data.get('email', instance.email)
        instance.save()
        return instance
