(self)
| 587 | |
| 588 | @property |
| 589 | def errors(self): |
| 590 | ret = super().errors |
| 591 | if isinstance(ret, list) and len(ret) == 1 and getattr(ret[0], 'code', None) == 'null': |
| 592 | # Edge case. Provide a more descriptive error than |
| 593 | # "this field may not be null", when no data is passed. |
| 594 | detail = ErrorDetail('No data provided', code='null') |
| 595 | ret = {api_settings.NON_FIELD_ERRORS_KEY: [detail]} |
| 596 | return ReturnDict(ret, serializer=self) |
| 597 | |
| 598 | |
| 599 | # There's some replication of `ListField` here, |
nothing calls this directly
no test coverage detected