<snip>
>
> One idea is this:
>
> ===========================================================================-====
>
> old_passwords = {}
> def save_old_pass(sender, instance, signal, *args, **kwargs):
>      user_obj = instance
>      old_pass = user_obj.password
>      old_passwords[user_obj] = old_pass
>
<snip>
>
> dispatcher.connect(save_old_pass, signal=signals.post_init, sender=User)
> dispatcher.connect(update, signal=signals.post_save, sender=User)
>
>
> This works, but save_old_pass() would be often called, if the user is logged 
> in.
> So it's not a really good idea.

It's also not a good idea to end up caching all your users' passwords
in the old_passwords dictionary like that.

>
> Any better ideas?

Create a custom view to allow your users to change just their
password. In that view, you will be able to tell in a straightforward
fashion if the user has changed her password and take action
accordingly.


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

Reply via email to