diff gpp/forums/signals.py @ 181:500e5875a306

Implementing #61: adding a forum topic subscription feature.
author Brian Neal <bgneal@gmail.com>
date Sun, 28 Mar 2010 01:07:47 +0000
parents 374b24dd2f9a
children a46788862737
line wrap: on
line diff
--- a/gpp/forums/signals.py	Sun Mar 21 20:33:33 2010 +0000
+++ b/gpp/forums/signals.py	Sun Mar 28 01:07:47 2010 +0000
@@ -3,8 +3,9 @@
 """
 from django.db.models.signals import post_save
 from django.db.models.signals import post_delete
-from models import Topic
-from models import Post
+
+from forums.models import Topic, Post
+from forums.subscriptions import notify_topic_subscribers
 
 
 def on_topic_save(sender, **kwargs):
@@ -32,6 +33,9 @@
         post.topic.forum.post_count_update()
         post.topic.forum.save()
 
+        # send out any email notifications
+        notify_topic_subscribers(post)
+
 
 def on_post_delete(sender, **kwargs):
     post = kwargs['instance']