Задать вопрос

Тел: +7 965 3737 888





Trigger a user password change

<p>I would like to catch the raw plaintext password if a user created or change his password. First i tried to handle this with signals.post_save at the User class, like this:
<p>dispatcher.connect(update, signal=signals.post_save, sender=User)
<p>The problem is, in the User model exists e.g. 'last_login'. So the save method called every time, the user logged in :( And with post_save i get only the hashed password and not the plaintext source password.
<p>I found a simple way to trigger a user password change. I hacked directly into the django.contrib.auth.models.User.set_password() method. See the sourcecode.
<p>There exists a discussion in the <a href="http://groups.google.com/group/django-users/browse_thread/thread/7c074e80a9cdcd21/">django-users thread</a> about this.

Вопрос полезен? Да0/Нет0

Ответы (1):

Ответ полезен? Да0/Нет0

Its not clear how to make use of this snippet? What is required in order to integrate into Django (and the Admin site)?