Opened 2 years ago

Closed 22 months ago

Last modified 22 months ago

#20134 closed Cleanup/optimization (fixed)

UserManager documentation doesn't mention that it depends on date_joined

Reported by: 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 Changed 2 years ago by pegler

  • Cc pegler@… added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

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 Changed 22 months ago by Tim Graham <timograham@…>

  • Resolution set to fixed
  • Status changed from new to closed

In da5069f68f9ec0cf80f50f6708d103afd56d23ae:

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

Thanks semenov and pegler.

comment:3 Changed 22 months ago by Tim Graham <timograham@…>

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 Changed 22 months ago by Tim Graham <timograham@…>

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