More helpful error message when default .create
fails. · Issue #2013 · encode/django-rest-framework (original) (raw)
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.