mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 17:47:04 +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_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