Changeset 241:5da74419c873


Ignore:
Timestamp:
17.02.2010 14:41:01 (2 years ago)
Author:
slav0nic <slav0nic0@…>
Branch:
default
Message:

fix #80: incorrect post count after deleting from admin panel

Location:
djangobb/djangobb_forum
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • djangobb/djangobb_forum/models.py

    r226 r241  
    200200        super(Post, self).save(*args, **kwargs) 
    201201 
     202 
    202203    def delete(self, *args, **kwargs): 
    203204        self_id = self.id 
     
    205206        forum = self.topic.forum 
    206207        topic = self.topic 
     208        profile = self.user.forum_profile 
    207209        self.last_topic_post.clear() 
    208210        self.last_forum_post.clear() 
     
    225227        forum.topic_count = Topic.objects.filter(forum=forum).count() 
    226228        forum.save() 
     229        profile.post_count = Post.objects.filter(user=self.user).count() 
     230        profile.save() 
    227231 
    228232    @models.permalink 
  • djangobb/djangobb_forum/views.py

    r239 r241  
    675675 
    676676    post.delete() 
    677     profile = post.user.forum_profile 
    678     profile.post_count = Post.objects.filter(user=post.user).count() 
    679     profile.save() 
    680677 
    681678    try: 
Note: See TracChangeset for help on using the changeset viewer.