mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-03 12:00:12 +03:00
There are some cases in which users may not want to have an error reply on any
, for exmaple on all
.
This commit is contained in:
parent
0178d3063d
commit
1bdf641dad
|
@ -630,7 +630,7 @@ class ListSerializer(BaseSerializer):
|
||||||
|
|
||||||
return value
|
return value
|
||||||
|
|
||||||
def to_internal_value(self, data):
|
def to_internal_value(self, data, error_function=any):
|
||||||
"""
|
"""
|
||||||
List of dicts of native values <- List of dicts of primitive datatypes.
|
List of dicts of native values <- List of dicts of primitive datatypes.
|
||||||
"""
|
"""
|
||||||
|
@ -666,7 +666,7 @@ class ListSerializer(BaseSerializer):
|
||||||
ret.append(validated)
|
ret.append(validated)
|
||||||
errors.append({})
|
errors.append({})
|
||||||
|
|
||||||
if any(errors):
|
if error_function(errors):
|
||||||
raise ValidationError(errors)
|
raise ValidationError(errors)
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
Loading…
Reference in New Issue
Block a user