diff gpp/forums/signals.py @ 390:e0523e17ea43

Fixing #175; add an auto-subscribe and auto-favorite forum topic feature. Added 2 flags to the user profile. Added 2 functions that are called on the post post-save signal that auto-favorite and auto-subscribe the post creator if they have requested this service.
author Brian Neal <bgneal@gmail.com>
date Mon, 21 Mar 2011 00:39:52 +0000
parents d1b11096595b
children 3b30286adba5
line wrap: on
line diff
--- a/gpp/forums/signals.py	Sun Mar 20 20:23:29 2011 +0000
+++ b/gpp/forums/signals.py	Mon Mar 21 00:39:52 2011 +0000
@@ -6,6 +6,7 @@
 
 from forums.models import Forum, Topic, Post
 from forums.views.subscriptions import notify_topic_subscribers
+from forums.tools import auto_favorite, auto_subscribe
 
 
 def on_topic_save(sender, **kwargs):
@@ -36,6 +37,10 @@
         # send out any email notifications
         notify_topic_subscribers(post)
 
+        # perform any auto-favorite and auto-subscribe actions for the new post
+        auto_favorite(post)
+        auto_subscribe(post)
+
 
 def on_post_delete(sender, **kwargs):
     post = kwargs['instance']