diff options
| author | Tim Graham <timograham@gmail.com> | 2017-02-11 13:39:35 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2019-04-07 20:09:15 -0400 |
| commit | 331d76528154407927f88759c9e520494e29b914 (patch) | |
| tree | 15b77185323c1fbe41e7329bb1233ac144d33f78 | |
| parent | d13490c18a075799aec1951ee7e260876b5d1ba6 (diff) | |
[1.11.x] Refs #27807 -- Removed docs for User.username_validator.
The new override functionality claimed in refs #21379 doesn't work.
Forwardport of 714fdbaa7048c2321f6238d9421137c33d9af7cc from stable/1.10.x.
| -rw-r--r-- | docs/ref/contrib/auth.txt | 24 | ||||
| -rw-r--r-- | docs/releases/1.10.txt | 9 |
2 files changed, 5 insertions, 28 deletions
diff --git a/docs/ref/contrib/auth.txt b/docs/ref/contrib/auth.txt index b503b02455..c557e8fe7a 100644 --- a/docs/ref/contrib/auth.txt +++ b/docs/ref/contrib/auth.txt @@ -38,8 +38,7 @@ Fields usernames. Although it wasn't a deliberate choice, Unicode characters have always been accepted when using Python 3. Django 1.10 officially added Unicode support in usernames, keeping the - ASCII-only behavior on Python 2, with the option to customize the - behavior using :attr:`.User.username_validator`. + ASCII-only behavior on Python 2. .. versionchanged:: 1.10 @@ -167,27 +166,6 @@ Attributes In older versions, this was a method. Backwards-compatibility support for using it as a method will be removed in Django 2.0. - .. attribute:: username_validator - - .. versionadded:: 1.10 - - Points to a validator instance used to validate usernames. Defaults to - :class:`validators.UnicodeUsernameValidator` on Python 3 and - :class:`validators.ASCIIUsernameValidator` on Python 2. - - To change the default username validator, you can subclass the ``User`` - model and set this attribute to a different validator instance. For - example, to use ASCII usernames on Python 3:: - - from django.contrib.auth.models import User - from django.contrib.auth.validators import ASCIIUsernameValidator - - class CustomUser(User): - username_validator = ASCIIUsernameValidator() - - class Meta: - proxy = True # If no new field is added. - Methods ------- diff --git a/docs/releases/1.10.txt b/docs/releases/1.10.txt index 8ce6581a85..3b7ca01468 100644 --- a/docs/releases/1.10.txt +++ b/docs/releases/1.10.txt @@ -60,12 +60,11 @@ wasn't a deliberate choice, Unicode characters have always been accepted when using Python 3. The username validator now explicitly accepts Unicode characters by -default on Python 3 only. This default behavior can be overridden by changing -the :attr:`~django.contrib.auth.models.User.username_validator` attribute of -the ``User`` model, or to any proxy of that model, using either +default on Python 3 only. + +Custom user models may use the new :class:`~django.contrib.auth.validators.ASCIIUsernameValidator` or -:class:`~django.contrib.auth.validators.UnicodeUsernameValidator`. Custom user -models may also use those validators. +:class:`~django.contrib.auth.validators.UnicodeUsernameValidator`. Minor features -------------- |
