Opened 17 years ago

Closed 17 years ago

#4923 closed (fixed)

poor wording in Authentication docs (create_user)

Reported by: djangotrac.20.skel@… Owned by: Jacob
Component: Documentation Version: dev
Severity: Keywords: authentication
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In the Authentication documentation under creating users there is some erroneous text:

http://www.djangoproject.com/documentation/authentication/#id1

>>> from django.contrib.auth.models import User
>>> user = User.objects.create_user('john', 'lennon@thebeatles.com', 'johnpassword')

# At this point, user is a User object ready to be saved
# to the database. You can continue to change its attributes
# if you want to change other fields.
>>> user.is_staff = True
>>> user.save()

The fact is, at that point the User object has ALREADY BEEN SAVED. The text implies that this has not yet happened.

Attachments (1)

authentication.diff (757 bytes ) - added by Simon G. <dev@…> 17 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 by anonymous, 17 years ago

Summary: error in Authentication docs (At this point, user is a User object ready to be saved)poor wording in Authentication docs (create_user)

comment:2 by djangotrac.20.skel@…, 17 years ago

I should mention that before this text it does say that create_user() automatically saves. However, the text in the example is misleading. Additionally, the url anchor takes you directly to the example, so you don't see the earlier explanation of the function.

comment:3 by John Shaffer <jshaffer2112@…>, 17 years ago

Triage Stage: UnreviewedAccepted

by Simon G. <dev@…>, 17 years ago

Attachment: authentication.diff added

comment:4 by Simon G. <dev@…>, 17 years ago

Has patch: set
Triage Stage: AcceptedReady for checkin

comment:5 by Adrian Holovaty, 17 years ago

Resolution: fixed
Status: newclosed

(In [6037]) Fixed #4923 -- Fixed error in docs/authentication.txt. Thanks, djangotrac.20.skel@…

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