Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#20134 closed Cleanup/optimization (fixed)

UserManager documentation doesn't mention that it depends on date_joined

Reported by: Ilya Semenov Owned by: nobody
Component: Documentation Version: 1.5
Severity: Normal Keywords:
Cc: pegler@… Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The documentation at https://docs.djangoproject.com/en/dev/topics/auth/customizing/ says:

If your User model defines username and email fields the same as Django’s default User, you can just install Django’s UserManager.

This is not true in the sense that these are not the only required fields for Django's UserManager to be a drop-in replacement. One has also to define MyUser.date_joined, otherwise UserManager.create_user(..) would fail to create a user.

The documentation should be updated to reflect that date_joined field is also required to use Django's UserManager.

Change History (4)

comment:1 by Matt, 11 years ago

Cc: pegler@… added
Triage Stage: UnreviewedAccepted

Agreed, the docs should be modified to indicate that UserManager requires is_staff, is_active, is_superuser, last_login, and date_joined fields to be used.

Best,
Matt

comment:2 by Tim Graham <timograham@…>, 11 years ago

Resolution: fixed
Status: newclosed

In da5069f68f9ec0cf80f50f6708d103afd56d23ae:

Fixed #20134 -- Correct list of fields that UserManager requires.

Thanks semenov and pegler.

comment:3 by Tim Graham <timograham@…>, 11 years ago

In 541a30c3768fa86ecb85ceea8545af175bada4fb:

[1.6.x] Fixed #20134 -- Correct list of fields that UserManager requires.

Thanks semenov and pegler.

Backport of da5069f68f from master.

comment:4 by Tim Graham <timograham@…>, 11 years ago

In 25d987b21e3af11b3ab3e37478a2dfd32f886d97:

[1.5.x] Fixed #20134 -- Correct list of fields that UserManager requires.

Thanks semenov and pegler.

Backport of da5069f68f from master.

Note: See TracTickets for help on using tickets.
Back to Top