mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 04:20:12 +03:00
Add docstring for CustomValidatorMessage
This commit is contained in:
parent
24391db49e
commit
460666db65
|
@ -299,6 +299,12 @@ except ImportError:
|
||||||
DecimalValidator = None
|
DecimalValidator = None
|
||||||
|
|
||||||
class CustomValidatorMessage(object):
|
class CustomValidatorMessage(object):
|
||||||
|
"""
|
||||||
|
We need to avoid evaluation of `lazy` translated `message` in `django.core.validators.BaseValidator.__init__`.
|
||||||
|
https://github.com/django/django/blob/75ed5900321d170debef4ac452b8b3cf8a1c2384/django/core/validators.py#L297
|
||||||
|
|
||||||
|
Ref: https://github.com/encode/django-rest-framework/pull/5452
|
||||||
|
"""
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
self.message = kwargs.pop('message', self.message)
|
self.message = kwargs.pop('message', self.message)
|
||||||
super(CustomValidatorMessage, self).__init__(*args, **kwargs)
|
super(CustomValidatorMessage, self).__init__(*args, **kwargs)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user