Browse Source

Update last updated on topic to use relationship

Alec Nikolas Reiter 7 years ago
parent
commit
fe387b339d
1 changed files with 1 additions and 2 deletions
  1. 1 2
      flaskbb/forum/models.py

+ 1 - 2
flaskbb/forum/models.py

@@ -269,8 +269,7 @@ class Post(db.Model, CRUDMixin):
             else:
             else:
                 self.topic.last_post = self.topic.first_post
                 self.topic.last_post = self.topic.first_post
 
 
-            post = Post.query.get(self.topic.last_post_id)
-            self.topic.last_updated = post.date_created
+            self.topic.last_updated = self.topic.last_post.date_created
 
 
         # Update the post counts
         # Update the post counts
         self.user.post_count -= 1
         self.user.post_count -= 1