Skip to content

Commit 020c1c4

Browse files
committed
[1.11.x] Fixed #28415 -- Clarified what characters ASCII/UnicodeUsernameValidator accept.
Backport of 14172cf from master
1 parent 6e6aa77 commit 020c1c4

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

docs/ref/contrib/auth.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ Fields
3434

3535
.. admonition:: Usernames and Unicode
3636

37-
Django originally accepted only ASCII letters in usernames.
38-
Although it wasn't a deliberate choice, Unicode characters have
39-
always been accepted when using Python 3. Django 1.10 officially
40-
added Unicode support in usernames, keeping the ASCII-only behavior
41-
on Python 2, with the option to customize the behavior using
42-
:attr:`.User.username_validator`.
37+
Django originally accepted only ASCII letters and numbers in
38+
usernames. Although it wasn't a deliberate choice, Unicode
39+
characters have always been accepted when using Python 3. Django
40+
1.10 officially added Unicode support in usernames, keeping the
41+
ASCII-only behavior on Python 2, with the option to customize the
42+
behavior using :attr:`.User.username_validator`.
4343

4444
.. versionchanged:: 1.10
4545

@@ -426,15 +426,15 @@ Validators
426426

427427
.. versionadded:: 1.10
428428

429-
A field validator allowing only ASCII letters, in addition to ``@``, ``.``,
430-
``+``, ``-``, and ``_``. The default validator for ``User.username`` on
431-
Python 2.
429+
A field validator allowing only ASCII letters and numbers, in addition to
430+
``@``, ``.``, ``+``, ``-``, and ``_``. The default validator for
431+
``User.username`` on Python 2.
432432

433433
.. class:: validators.UnicodeUsernameValidator
434434

435435
.. versionadded:: 1.10
436436

437-
A field validator allowing Unicode letters, in addition to ``@``, ``.``,
437+
A field validator allowing Unicode characters, in addition to ``@``, ``.``,
438438
``+``, ``-``, and ``_``. The default validator for ``User.username`` on
439439
Python 3.
440440

docs/releases/1.10.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ Official support for Unicode usernames
5555
--------------------------------------
5656

5757
The :class:`~django.contrib.auth.models.User` model in ``django.contrib.auth``
58-
originally only accepted ASCII letters in usernames. Although it wasn't a
59-
deliberate choice, Unicode characters have always been accepted when using
60-
Python 3.
58+
originally only accepted ASCII letters and numbers in usernames. Although it
59+
wasn't a deliberate choice, Unicode characters have always been accepted when
60+
using Python 3.
6161

62-
The username validator now explicitly accepts Unicode letters by
62+
The username validator now explicitly accepts Unicode characters by
6363
default on Python 3 only. This default behavior can be overridden by changing
6464
the :attr:`~django.contrib.auth.models.User.username_validator` attribute of
6565
the ``User`` model, or to any proxy of that model, using either

0 commit comments

Comments
 (0)