Clarified EmailValidator docs to specify it validates an email address.
Some checks are pending
Docs / spelling (push) Waiting to run
Docs / blacken-docs (push) Waiting to run
Docs / lint-docs (push) Waiting to run

Updated the EmailValidator docs in docs/ref/validators.txt to explicitly
state that it validates an email address, to avoid confusion with
validating email message content.
This commit is contained in:
Hong Xu 2025-08-03 22:25:34 -07:00 committed by nessita
parent c4e07f94eb
commit a4f7674134

View file

@ -133,8 +133,8 @@ to, or in lieu of custom ``field.clean()`` methods.
:param code: If not ``None``, overrides :attr:`code`.
:param allowlist: If not ``None``, overrides :attr:`allowlist`.
An :class:`EmailValidator` ensures that a value looks like an email, and
raises a :exc:`~django.core.exceptions.ValidationError` with
An :class:`EmailValidator` ensures that a value looks like an email
address, and raises a :exc:`~django.core.exceptions.ValidationError` with
:attr:`message` and :attr:`code` if it doesn't. Values longer than 320
characters are always considered invalid.