mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Refs #31670 -- Renamed whitelist argument and attribute of EmailValidator.
This commit is contained in:
parent
26a413507a
commit
27c09043da
6 changed files with 104 additions and 18 deletions
|
@ -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``
|
||||
----------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue