Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#19868 closed Uncategorized (fixed)

Custom User Models documentation

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

Description

The documentation for creating a custom user model uses the ReadOnlyPasswordHashField in the documentation. The problem with this is that it disallows users to actually change the password when they're using that field by itself. It should be changed to the following:

password = ReadOnlyPasswordHashField(label=_("Password"),
    help_text=_("Raw passwords are not stored, so there is no way to see "
                "this user's password, but you can change the password "
                "using <a href=\"password/\">this form</a>."))

https://docs.djangoproject.com/en/dev/topics/auth/customizing/#a-full-example

Change History (4)

comment:1 Changed 4 years ago by Preston Holmes

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Triage Stage: UnreviewedAccepted

This is not meant to be a copy-paste example, but more of an illustration of all the parts working together. The docstring of the UserChangeForm makes clear what it is composed of - your comment adds greater usability in an actual project, but does not add to the example as an illustration.

Such a disclaimer is perhaps worth adding to the introduction of the full example.

comment:2 Changed 4 years ago by Preston Holmes <preston@…>

Resolution: fixed
Status: newclosed

In 649118961ce3952138536235fc842921e39bfa33:

Fixed #19868 -- Clarified purpose of custom user example

comment:3 Changed 4 years ago by Preston Holmes <preston@…>

In b17a572eb36acfa59cdf001c4ed3b965ade2b7a7:

[1.5.x] Fixed #19868 -- Clarified purpose of custom user example

comment:4 Changed 4 years ago by ArrantSquid

Understood. Makes sense. Thanks.

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