summaryrefslogtreecommitdiff
path: root/docs/ref/validators.txt
diff options
context:
space:
mode:
authorDavid Smith <smithdc@gmail.com>2020-06-17 07:35:09 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-06-18 21:43:20 +0200
commit27c09043da52ca1f02605bf28600bfd5ace95ae4 (patch)
treeb9fb0d8d11a736943e4bab5ea2982bb8d96d6477 /docs/ref/validators.txt
parent26a413507abb38f7eee4cf62f2ee9727fdc7bf8d (diff)
Refs #31670 -- Renamed whitelist argument and attribute of EmailValidator.
Diffstat (limited to 'docs/ref/validators.txt')
-rw-r--r--docs/ref/validators.txt26
1 files changed, 17 insertions, 9 deletions
diff --git a/docs/ref/validators.txt b/docs/ref/validators.txt
index 6374f4e8cd..4669ba28d7 100644
--- a/docs/ref/validators.txt
+++ b/docs/ref/validators.txt
@@ -119,11 +119,11 @@ to, or in lieu of custom ``field.clean()`` methods.
``EmailValidator``
------------------
-.. class:: EmailValidator(message=None, code=None, whitelist=None)
+.. class:: EmailValidator(message=None, code=None, allowlist=None)
:param message: If not ``None``, overrides :attr:`.message`.
:param code: If not ``None``, overrides :attr:`code`.
- :param whitelist: If not ``None``, overrides :attr:`whitelist`.
+ :param allowlist: If not ``None``, overrides :attr:`allowlist`.
.. attribute:: message
@@ -136,14 +136,22 @@ to, or in lieu of custom ``field.clean()`` methods.
The error code used by :exc:`~django.core.exceptions.ValidationError`
if validation fails. Defaults to ``"invalid"``.
- .. attribute:: whitelist
+ .. attribute:: allowlist
- Whitelist of email domains to allow. By default, a regular expression
- (the ``domain_regex`` attribute) is used to validate whatever appears
- after the @ sign. However, if that string appears in the whitelist, this
- validation is bypassed. If not provided, the default whitelist is
- ``['localhost']``. Other domains that don't contain a dot won't pass
- validation, so you'd need to whitelist them as necessary.
+ Allowlist of email domains. By default, a regular expression (the
+ ``domain_regex`` attribute) is used to validate whatever appears after
+ the ``@`` sign. However, if that string appears in the ``allowlist``,
+ this validation is bypassed. If not provided, the default ``allowlist``
+ is ``['localhost']``. Other domains that don't contain a dot won't pass
+ validation, so you'd need to add them to the ``allowlist`` as
+ necessary.
+
+ .. deprecated:: 3.2
+
+ The ``whitelist`` parameter is deprecated. Use :attr:`allowlist`
+ instead.
+ The undocumented ``domain_whitelist`` attribute is deprecated. Use
+ ``domain_allowlist`` instead.
``URLValidator``
----------------