If you hook into pre_save, you can compare agaist the DB with MyModel.objects.get(id=object.id)
I think there might be a way of checking directly on the instance if a field's been changed in 1.4
-----Mensaje original-----
De: Roarster
Enviados: 24/10/2012 18:23:15
Asunto: Best way to detect 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 into this view or if I should use a signal on post_save for
the user. If I do use the signal, is it possible to tell when the password
has been changed? I do feel that if I can use a signal this might be the
best approach since it would handle any other password change mechanisms
that I might add later without any extra work.
Does anyone have any ideas on the best way to do this?
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/yrhcGbYf0f4J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
--
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 django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment