Hi, if I digress from the has_changed() problem, you mentioned you wanted to send email after a user profile has changed. Assuming that the profile is a model in the database, you might consider tying your logic to the model rather than the form.
The post_save signal tied to the profile-related model might just do the trick for you. Cheers Jirka On 07/01/2010, Alastair Campbell <ala...@gmail.com> wrote: > Hi everyone, > > I've been looking for a simple way to send an email when a user > updates their profile. > > After some digging I found form.has_changed() which appears to fit the > bill. However, it always seems to return true, so I could end up > bombarding our elderly admin lady with lots of useless emails. > > I'm using a simple model form (with a sub-set of the available > fields), rendered in the default manner, no hidden fields or anything. > If I open the page, hit save, if form.has_changed(): runs. > > Is there anything else that might cause has_changed to be true? > > Perhaps this is why has_changed() isn't mentioned in the documentation? > > I kinda hope I'm being stupid on this one, I'd rather not get into a > long comparison function! > > -Alastair > -- 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.