Django

Code

Ticket #4923 (closed: fixed)

Opened 1 year ago

Last modified 1 year ago

poor wording in Authentication docs (create_user)

Reported by: djangotrac.20.skel@spamgourmet.org Assigned to: jacob
Milestone: Component: Documentation
Version: SVN Keywords: authentication
Cc: Triage Stage: Ready for checkin
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

authentication.diff (0.7 kB) - added by Simon G. <dev@simon.net.nz> on 08/12/07 05:32:55.

Change History

07/18/07 22:42:00 changed by anonymous

  • needs_better_patch changed.
  • summary changed from error in Authentication docs (At this point, user is a User object ready to be saved) to poor wording in Authentication docs (create_user).
  • needs_tests changed.
  • needs_docs changed.

07/18/07 22:45:55 changed by djangotrac.20.skel@spamgourmet.org

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.

07/18/07 23:40:28 changed by John Shaffer <jshaffer2112@gmail.com>

  • stage changed from Unreviewed to Accepted.

08/12/07 05:32:55 changed by Simon G. <dev@simon.net.nz>

  • attachment authentication.diff added.

08/12/07 05:33:09 changed by Simon G. <dev@simon.net.nz>

  • has_patch set to 1.
  • stage changed from Accepted to Ready for checkin.

09/03/07 01:16:47 changed by adrian

  • status changed from new to closed.
  • resolution set to fixed.

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


Add/Change #4923 (poor wording in Authentication docs (create_user))




Change Properties
Action