comparison forums/tools.py @ 781:b6d6c9e37fae

Issue #68, calendar generated forum threads should be indexed.
author Brian Neal <bgneal@gmail.com>
date Sun, 04 May 2014 15:37:56 -0500
parents ee87ea74d46b
children 9e803323a0d0
comparison
equal deleted inserted replaced
780:feafa1c3d356 781:b6d6c9e37fae
2 This module contains misc. utility functions for forum management. 2 This module contains misc. utility functions for forum management.
3 """ 3 """
4 import logging 4 import logging
5 5
6 from forums.models import Post, Topic, Forum, ForumLastVisit, TopicLastVisit 6 from forums.models import Post, Topic, Forum, ForumLastVisit, TopicLastVisit
7 from forums.signals import notify_new_topic, notify_new_post
7 8
8 9
9 def delete_user_posts(user): 10 def delete_user_posts(user):
10 """ 11 """
11 This function deletes all the posts for a given user. 12 This function deletes all the posts for a given user.
105 user=user, 106 user=user,
106 body=post_body, 107 body=post_body,
107 user_ip=ip) 108 user_ip=ip)
108 post.save() 109 post.save()
109 110
111 notify_new_topic(topic)
112 notify_new_post(post)
113
110 114
111 def auto_favorite(post): 115 def auto_favorite(post):
112 """ 116 """
113 Given a newly created post, perform an auto-favorite action if the post 117 Given a newly created post, perform an auto-favorite action if the post
114 creator has that option set in their profile. 118 creator has that option set in their profile.