Re: Best way to detect if a user has changed password

2012-11-19 Thread Roarster
Ended up using Tom's method in the end (thanks!) - it seemed more efficient than grabbing the user object back out of the database to do a password comparison on every save. On Thursday, 25 October 2012 11:41:54 UTC+1, Tom Evans wrote: > > On Wed, Oct 24, 2012 at 10:23 PM, Roarster > > > wrote

Re: Best way to detect if a user has changed password

2012-10-25 Thread Tom Evans
On Wed, Oct 24, 2012 at 10:23 PM, Roarster wrote: > I'm running a Django 1.4 site and I have some operations I want to perform > if a user changes their password. I'm using the standard contrib.auth user > accounts with the normal password_change view and I'm not sure if I should > somehow hook i

Re: Best way to detect if a user has changed password

2012-10-25 Thread Roarster
Thanks for the answers, that was pretty much what I was expecting. I haven't had a chance to test this yet but do you think it'll be as simple as just comparing the value with the previous value, seeing as the password field is (I assume) a bit different with it storing the hash rather than th

RE: Best way to detect if a user has changed password

2012-10-24 Thread lacrymol...@gmail.com
etect if a user has changed password I'm running a Django 1.4 site and I have some operations I want to perform if a user changes their password. I'm using the standard contrib.auth user accounts with the normal password_change view and I'm not sure if I should somehow hook in

Re: Best way to detect if a user has changed password

2012-10-24 Thread Brad Pitcher
You could use a "pre_save" signal. kwargs['instance'] will contain the updated record and you can get the old record with "User.objects.get(id= user.id) if user.pk else None". I've done this in the past to check for a changed email address. On Wed, Oct 24, 2012 at 2:23 PM, Roarster wrote: > I'm

Best way to detect if a user has changed password

2012-10-24 Thread Roarster
I'm running a Django 1.4 site and I have some operations I want to perform if a user changes their password. I'm using the standard contrib.auth user accounts with the normal password_change view and I'm not sure if I should somehow hook into this view or if I should use a signal on post_save f