How can I add a function to confirm password using check_password?

class RegisterSerializer(serializers.ModelSerializer):
    password2=serializers.CharField( style={'input_type': 'password'},label="Confirm Password",required=True)

    email=serializers.EmailField(required=False)

    class Meta:
        model=User
        fields=['id','username','email','password','password2']
        extra_kwargs={'password':{'write_only':True}}


    def validate_password2(self, value):
     if not self.instance.check_password(value):
        raise serializers.ValidationError("Current password is not correct")
     return value

    def validate_email(self, email):
        existing = User.objects.filter(email=email).first()
        if existing:
            raise serializers.ValidationError("Someone with that email "
                "address has already registered")

        return email


    def validate_password(self,value):
        password_validation.validate_password(value, self.instance)
        return value



    def create(self,validated_data):
        user=User.objects.create_user(validated_data['username'],
        validated_data['email'],validated_data['password'])
        return user