#16728: Registering custom Admin class for User model breaks changing passwords
-------------------------------------+-------------------------------------
Reporter: | Owner: nobody
django.bigfudge@… | Status: closed
Type: Bug | Component: contrib.admin
Milestone: | Severity: Normal
Version: 1.3 | Keywords:
Resolution: invalid | Has patch: 0
Triage Stage: | Needs tests: 0
Unreviewed | Easy pickings: 0
Needs documentation: 0 |
Patch needs improvement: 0 |
UI/UX: 0 |
-------------------------------------+-------------------------------------
Changes (by aaugustin):
* status: new => closed
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
* resolution: => invalid
Old description:
> I am doing this:
>
> class UserProfileInline(admin.StackedInline):
> model = UserProfile
>
> class UserAdmin(admin.ModelAdmin):
> save_on_top = True
> inlines = [UserProfileInline]
>
> admin.site.unregister(User)
> admin.site.register(User, UserAdmin)
>
> To allow me to edit UserProfiles inline with Users. However, doing this
> seems to break the password reset feature within django admin (not the
> user-facing password reset – the one on the User model itself which
> allows and administrator to set a user's password manually. The error is:
>
> user object with primary key u'3/password' does not exist.
New description:
I am doing this:
{{{
class UserProfileInline(admin.StackedInline):
model = UserProfile
class UserAdmin(admin.ModelAdmin):
save_on_top = True
inlines = [UserProfileInline]
admin.site.unregister(User)
admin.site.register(User, UserAdmin)
}}}
To allow me to edit UserProfiles inline with Users. However, doing this
seems to break the password reset feature within django admin (not the
user-facing password reset – the one on the User model itself which allows
and administrator to set a user's password manually. The error is:
user object with primary key u'3/password' does not exist.
--
Comment:
Indeed, your code doesn't work. You may have more luck if you subclass
`django.contrib.auth.admin.UserAdmin` (I haven't tested).
Anyway, that isn't a bug in Django. Could you use the django-users mailing
list or the #django IRC channel for this kind of requests? Trac is the
place for reporting bugs, it isn't a support forum. Thanks :)
--
Ticket URL: <https://code.djangoproject.com/ticket/16728#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.