Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

input_type class name is not displayed in error message when message_list_attr is not a mutable sequence #244

Open
AMontagu opened this issue Dec 18, 2023 · 0 comments

Comments

@AMontagu
Copy link
Collaborator

this code in proto_serializers.py:

repeated_message = getattr(message, message_list_attr, "")
        if not isinstance(repeated_message, MutableSequence):
            error_message = self.default_error_messages["not_a_list"].format( # TODO not working anymore for custome input_type
                input_type=repeated_message.__class__.__name__
            )
            raise ValidationError(
                {api_settings.NON_FIELD_ERRORS_KEY: [error_message]}, code="not_a_list"
            )

Work but input_type=repeated_message.class.name is not correctly printed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant