2010/5/4 zinckiwi <zinck...@gmail.com> > On May 4, 9:49 am, Sander <sander.garret...@gmail.com> wrote: > > I don't want to check if if_active = True > > I wan't to check if if_active is changed to True > > If you use the pre_save signal, you can get the object as it currently > exists (based in the signalled instance's pk) and compare the existing > object's `is_active` with the signalled instance's `is_active`. Of > course, then you run into the problem of the email being sent even if > the save itself fails, so you might then want to figure out a way of > persisting a flag from pre_save (which determines whether an email > should be sent) to post_save (which does the sending). Might be over- > engineering it, though. >
I solved with this code: http://dpaste.com/192120/ and pre_save.connect(account_moderated_email, sender=Profile) -- Alessandro Ronchi http://www.soasi.com SOASI - Sviluppo Software e Sistemi Open Source Hobby & Giochi, l'e-commerce del divertimento http://hobbygiochi.com http://www.facebook.com/hobbygiochi -- 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.