Opened 13 years ago

Closed 13 years ago

#16728 closed Bug (invalid)

Registering custom Admin class for User model breaks changing passwords — at Version 1

Reported by: django.bigfudge@… Owned by: nobody
Component: contrib.admin Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Aymeric Augustin)

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.

Change History (1)

comment:1 by Aymeric Augustin, 13 years ago

Description: modified (diff)
Resolution: invalid
Status: newclosed

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 :)

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