[6.0.x] Clarified EmailValidator docs to specify it validates an email address.

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.

Backport of a4f7674134 from main.
This commit is contained in:
Hong Xu
2025-08-03 22:25:34 -07:00
committed by Natalia
parent fb2fb2de4d
commit cdae630530

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.