Django "comment_was_flagged" signal

Posted by tsoporan on Stack Overflow See other posts from Stack Overflow or by tsoporan
Published on 2010-03-30T18:40:25Z Indexed on 2010/03/30 18:43 UTC
Read the original article Hit count: 684

Hello,

This is my first time working with django signals and I would like to hook the "comment_was_flagged" signal provided by the comments app to notify me when a comment is flagged.

This is my code, but it doesn't seem to work, am I missing something?

from django.contrib.comments.signals import comment_was_flagged
from django.core.mail import send_mail

def comment_flagged_notification(sender, **kwargs):
  send_mail('testing moderation', 'testing', 'test@localhost', ['[email protected]',])

comment_was_flagged.connect(comment_flagged_notification)

(I am just testing the email for now, but I have assured the email is sending properly.)

Thanks!

© Stack Overflow or respective owner

Related posts about django

Related posts about django-comments