Opened 16 years ago

Closed 15 years ago

#8140 closed (fixed)

User.objects.create_superuser should return the new User instance

Reported by: Dan Fairs Owned by: Gary Wilson
Component: Contrib apps Version: dev
Severity: Keywords:
Cc: siddhartag@…, zerok@… 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

There's a small inconsistency in django.contrib.admin.models.UserManager: create_user() returns the user object that has just been created, but create_superuser() doesn't. It would lead to shorter code (probably mostly in tests) if create_superuser() returned the user object too.

This is the case as of svn r8223.

Attachments (1)

superuser.diff (648 bytes ) - added by Eric Holscher 15 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 by Dan Fairs, 16 years ago

Component: AuthenticationContrib apps
Owner: set to nobody

comment:2 by Eric Holscher, 16 years ago

Has patch: set
milestone: post-1.0
Owner: changed from nobody to Eric Holscher
Status: newassigned

Added patch, set for post 1.0 because you can work around it, but for consistency it does make sense.

comment:3 by Eric Holscher, 16 years ago

Triage Stage: UnreviewedAccepted

comment:4 by Evgeny Sizikov, 16 years ago

I would vote for including this upstream before 1.0 release, too. it doesn't seems like returning a newly created user instance could broke anything...

comment:5 by siddhi, 15 years ago

Cc: siddhartag@… added

comment:6 by (none), 15 years ago

milestone: post-1.0

Milestone post-1.0 deleted

comment:7 by Horst Gutmann <zerok@…>, 15 years ago

Cc: zerok@… added

by Eric Holscher, 15 years ago

Attachment: superuser.diff added

comment:8 by Eric Holscher, 15 years ago

Triage Stage: AcceptedReady for checkin

[16:18] <jacobkm> ericholscher: once you learn how to spell "u", go ahead and mark it rfc.

comment:9 by Gary Wilson, 15 years ago

Owner: changed from Eric Holscher to Gary Wilson
Status: assignednew

comment:10 by Gary Wilson, 15 years ago

Status: newassigned

comment:11 by Gary Wilson, 15 years ago

Resolution: fixed
Status: assignedclosed

(In [10217]) Fixed #8140 -- Made UserManager.create_superuser return the new User object, based on patch from ericholscher.

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