Opened 16 years ago
Closed 16 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)
Change History (12)
comment:1 by , 16 years ago
Component: | Authentication → Contrib apps |
---|---|
Owner: | set to |
comment:2 by , 16 years ago
Has patch: | set |
---|---|
milestone: | → post-1.0 |
Owner: | changed from | to
Status: | new → assigned |
comment:3 by , 16 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:4 by , 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 , 16 years ago
Cc: | added |
---|
comment:7 by , 16 years ago
Cc: | added |
---|
by , 16 years ago
Attachment: | superuser.diff added |
---|
comment:8 by , 16 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
[16:18] <jacobkm> ericholscher: once you learn how to spell "u", go ahead and mark it rfc.
comment:9 by , 16 years ago
Owner: | changed from | to
---|---|
Status: | assigned → new |
comment:10 by , 16 years ago
Status: | new → assigned |
---|
comment:11 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Added patch, set for post 1.0 because you can work around it, but for consistency it does make sense.