diff options
| author | Thom Wiggers <thom@thomwiggers.nl> | 2017-01-22 15:45:42 +0100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-01-28 09:29:00 -0500 |
| commit | d5b573d872bbe0d5825efaee2d41cb3cdc75417b (patch) | |
| tree | 3ae230039a3802d0e7b3b1bfbb28d2a41a11e7e0 /docs | |
| parent | 0de0699d94ccd078c83eadef296a0d9ccd65a62f (diff) | |
Fixed #26993 -- Increased User.last_name max_length to 150 characters.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/contrib/auth.txt | 6 | ||||
| -rw-r--r-- | docs/releases/2.0.txt | 27 |
2 files changed, 32 insertions, 1 deletions
diff --git a/docs/ref/contrib/auth.txt b/docs/ref/contrib/auth.txt index a269230643..265dc53579 100644 --- a/docs/ref/contrib/auth.txt +++ b/docs/ref/contrib/auth.txt @@ -47,7 +47,11 @@ Fields .. attribute:: last_name - Optional. 30 characters or fewer. + Optional. 150 characters or fewer. + + .. versionchanged:: 2.0 + + The ``max_length`` increased from 30 to 150 characters. .. attribute:: email diff --git a/docs/releases/2.0.txt b/docs/releases/2.0.txt index 2ef6ba9be1..7cb9b5da73 100644 --- a/docs/releases/2.0.txt +++ b/docs/releases/2.0.txt @@ -217,6 +217,33 @@ The end of upstream support for Oracle 11.2 is Dec. 2020. Django 1.11 will be supported until April 2020 which almost reaches this date. Django 2.0 officially supports Oracle 12.1+. +:attr:`AbstractUser.last_name <django.contrib.auth.models.User.last_name>` ``max_length`` increased to 150 +---------------------------------------------------------------------------------------------------------- + +A migration for :attr:`django.contrib.auth.models.User.last_name` is included. +If you have a custom user model inheriting from ``AbstractUser``, you'll need +to generate and apply a database migration for your user model. + +If you want to preserve the 30 character limit for last names, use a custom +form:: + + from django.contrib.auth.forms import UserChangeForm + + class MyUserChangeForm(UserChangeForm): + last_name = forms.CharField(max_length=30, required=False) + +If you wish to keep this restriction in the admin when editing users, set +``UserAdmin.form`` to use this form:: + + from django.contrib.auth.admin import UserAdmin + from django.contrib.auth.models import User + + class MyUserAdmin(UserAdmin): + form = MyUserChangeForm + + admin.site.unregister(User) + admin.site.register(User, MyUserAdmin) + Miscellaneous ------------- |
