wired up notifications

pull/1/head
eric 2012-03-27 13:24:16 -04:00
parent 3925e96ad1
commit 290aecab19
2 changed files with 9 additions and 1 deletions

View File

@ -65,3 +65,11 @@ def create_notice_types(app, created_models, verbosity, **kwargs):
notification.create_notice_type("wishlist_comment", _("Wishlist Comment"), _("a comment has been received on one of your wishlist books"))
signals.post_syncdb.connect(create_notice_types, sender=notification)
from django.contrib.comments.signals import comment_was_posted
def notify_comment(comment, request, **kwargs):
notification.send(comment.content_object.wished_by, "wishlist_comment", {}, True)
comment_was_posted.connect(notify_comment)

View File

@ -1 +1 @@
{{ comment.user.username }} has commented on {{ content_object.title }}
{{ comment.user.username }} has commented on {{ comment.content_object.title }}