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

More helpful error message when default .create fails. #2013

Closed
tomchristie opened this issue Nov 3, 2014 · 1 comment
Closed

More helpful error message when default .create fails. #2013

tomchristie opened this issue Nov 3, 2014 · 1 comment

Comments

@tomchristie
Copy link
Member

tomchristie commented Nov 3, 2014

If the default .create method on ModelSerializer fails with TypeError then it'll typically be because it's passed an incorrect parameter to the MyModel.objects.create() method. Eg.

TypeError("'%s' is an invalid keyword argument for this function" % list(kwargs)[0])

We should highlight this type of issue to users, and make it more obvious & easy to resolve.

@tomchristie
Copy link
Member Author

tomchristie commented Nov 3, 2014

Example case where this can happen... user creates a non-model field on the ModelSerializer class.

@tomchristie tomchristie modified the milestone: 3.0.1 Release Dec 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant