Editing user profiles via "inlines" breaks password management in admin site

2010-10-13 Thread Martin Burger
Hello,

I implemented a user profile that is activated via AUTH_PROFILE_MODULE
in settings.py. In order to be able to view and edit user profiles in
the admin site, I used the method described at
http://stackoverflow.com/questions/3400641/how-do-i-inline-edit-a-django-user-profile-in-the-admin-interface.
Basically, this method uses a custom ModelAdmin to enable inline
editing.

While editing users and their profiles via 
http://127.0.0.1:8000/admin/auth/user//
works as expected, I cannot add users as before enabling inline
editing. Before, the interface at http://127.0.0.1:8000/admin/auth/user/add/
had showed a rather simple form with fields username, password, and
password confirmation. Now, this page shows the same (more complex)
form as when editing users. Thus, I have to provide a password in the
form of "[algo]$[salt]$[hexdigest]".

Furthermore, the function "change password" at
http://127.0.0.1:8000/admin/auth/user//password/ does not work
anymore: "user object with primary key u'/password' does not
exist."

How can I enable viewing / editing of user profiles while preserving
the original password functionality?

Regards,

Martin Burger

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Editing user profiles via "inlines" breaks password management in admin site

2010-10-13 Thread Martin Burger
Oh, thanks! Actually, it's much simpler this way.

On Oct 13, 12:29 pm, Jonathan Barratt 
wrote:
> On 13 ต.ค. 2010, at 17:19, Martin Burger wrote:
>
> > Hello,
>
> > I implemented a user profile that is activated via AUTH_PROFILE_MODULE
> > in settings.py. In order to be able to view and edit user profiles in
> > the admin site, I used the method described at
> >http://stackoverflow.com/questions/3400641/how-do-i-inline-edit-a-dja
> > Basically, this method uses a custom ModelAdmin to enable inline
> > editing.
>
> > 
> > How can I enable viewing / editing of user profiles while preserving
> > the original password functionality?
>
> The way I'm doing this is just to add 
> "admin.site.register(models.UserProfile)" to my admin.py
>
> This makes the user profiles available through the admin section as a 
> separate entity, like any other model class. It's not in-line editing under 
> the same section as the basic Django user module, so you do have to create 
> the user first and then create their profile separately, but it avoids the 
> problems you're running into and seems like the simplest solution to your 
> problem to me...
>
> Others with more Django experience may have a better answer for you though.
>
> Best wishes,
> Jonathan

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.