mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 12:30:11 +03:00
Added default value for 'detail' param into 'ValidationError' exception
This commit is contained in:
parent
4d5e846ca7
commit
a7d3cc62c9
|
@ -123,7 +123,7 @@ class ValidationError(APIException):
|
|||
default_detail = _('Invalid input.')
|
||||
default_code = 'invalid'
|
||||
|
||||
def __init__(self, detail, code=None):
|
||||
def __init__(self, detail=None, code=None):
|
||||
if detail is None:
|
||||
detail = self.default_detail
|
||||
if code is None:
|
||||
|
|
Loading…
Reference in New Issue
Block a user