mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-06-22 06:23:17 +03:00
Added default value for 'detail' param into 'ValidationError' exception (#5342)
This commit is contained in:
parent
607e4edca7
commit
ab7e5c4551
|
@ -123,7 +123,7 @@ class ValidationError(APIException):
|
||||||
default_detail = _('Invalid input.')
|
default_detail = _('Invalid input.')
|
||||||
default_code = 'invalid'
|
default_code = 'invalid'
|
||||||
|
|
||||||
def __init__(self, detail, code=None):
|
def __init__(self, detail=None, code=None):
|
||||||
if detail is None:
|
if detail is None:
|
||||||
detail = self.default_detail
|
detail = self.default_detail
|
||||||
if code is None:
|
if code is None:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user