(self)
| 811 | |
| 812 | @property |
| 813 | def errors(self): |
| 814 | ret = super().errors |
| 815 | if isinstance(ret, list) and len(ret) == 1 and getattr(ret[0], 'code', None) == 'null': |
| 816 | # Edge case. Provide a more descriptive error than |
| 817 | # "this field may not be null", when no data is passed. |
| 818 | detail = ErrorDetail('No data provided', code='null') |
| 819 | ret = {api_settings.NON_FIELD_ERRORS_KEY: [detail]} |
| 820 | if isinstance(ret, dict): |
| 821 | return ReturnDict(ret, serializer=self) |
| 822 | return ReturnList(ret, serializer=self) |
| 823 | |
| 824 | |
| 825 | # ModelSerializer & HyperlinkedModelSerializer |
nothing calls this directly
no test coverage detected