Browse Source

Merge pull request #303 from justanr/Fix-Out-of-Order-Topics

Update Topic.last_updated on Post delete
Peter Justin 7 years ago
parent
commit
f7159fda6d
1 changed files with 3 additions and 0 deletions
  1. 3 0
      flaskbb/forum/models.py

+ 3 - 0
flaskbb/forum/models.py

@@ -266,6 +266,9 @@ class Post(db.Model, CRUDMixin):
             else:
                 self.topic.last_post_id = self.topic.first_post_id
 
+            post = Post.query.get(self.topic.last_post_id)
+            self.topic.last_updated = post.date_created
+
         # Update the post counts
         self.user.post_count -= 1
         self.topic.post_count -= 1