comparison gpp/forums/views/main.py @ 562:98b373ca09f3

For bitbucket issue #3, ensure that changes to Profile, Post & Topic models via the admin cause the search index to be updated.
author Brian Neal <bgneal@gmail.com>
date Wed, 08 Feb 2012 18:58:57 -0600
parents 7388cdf61b25
children 4b9970ad0edb
comparison
equal deleted inserted replaced
561:8f3b7f0d4d13 562:98b373ca09f3
32 from forums.forms import (NewTopicForm, NewPostForm, PostForm, MoveTopicForm, 32 from forums.forms import (NewTopicForm, NewPostForm, PostForm, MoveTopicForm,
33 SplitTopicForm) 33 SplitTopicForm)
34 from forums.unread import (get_forum_unread_status, get_topic_unread_status, 34 from forums.unread import (get_forum_unread_status, get_topic_unread_status,
35 get_post_unread_status, get_unread_topics) 35 get_post_unread_status, get_unread_topics)
36 36
37 from forums.attachments import AttachmentProcessor
38 import forums.permissions as perms 37 import forums.permissions as perms
39 from forums.signals import (notify_new_topic, notify_updated_topic, 38 from forums.signals import (notify_new_topic, notify_updated_topic,
40 notify_new_post, notify_updated_post) 39 notify_new_post, notify_updated_post)
41 from forums.latest import get_latest_topic_ids 40 from forums.latest import get_latest_topic_ids
42 41
525 """ 524 """
526 # Adjust post creator's post count 525 # Adjust post creator's post count
527 profile = post.user.get_profile() 526 profile = post.user.get_profile()
528 if profile.forum_post_count > 0: 527 if profile.forum_post_count > 0:
529 profile.forum_post_count -= 1 528 profile.forum_post_count -= 1
530 profile.save() 529 profile.save(content_update=False)
531 530
532 # If this post is the last_post in a topic, we need to update 531 # If this post is the last_post in a topic, we need to update
533 # both the topic and parent forum's last post fields. If we don't 532 # both the topic and parent forum's last post fields. If we don't
534 # the cascading delete will delete them also! 533 # the cascading delete will delete them also!
535 534
997 """ 996 """
998 Increments the forum_post_count for the given user. 997 Increments the forum_post_count for the given user.
999 """ 998 """
1000 profile = user.get_profile() 999 profile = user.get_profile()
1001 profile.forum_post_count += 1 1000 profile.forum_post_count += 1
1002 profile.save() 1001 profile.save(content_update=False)
1003 1002
1004 1003
1005 def _quote_message(who, message): 1004 def _quote_message(who, message):
1006 """ 1005 """
1007 Builds a message reply by quoting the existing message in a 1006 Builds a message reply by quoting the existing message in a