|
@@ -248,11 +248,15 @@ class Post(db.Model, CRUDMixin):
|
|
order_by(Post.id.desc()).limit(2).offset(0).\
|
|
order_by(Post.id.desc()).limit(2).offset(0).\
|
|
all()
|
|
all()
|
|
|
|
|
|
- second_last_post = second_last_post[1]
|
|
+
|
|
-
|
|
+ last_post = second_last_post[1]
|
|
- self.topic.forum.last_post_id = second_last_post.id
|
|
+ self.topic.forum.last_post_id = last_post.id
|
|
-
|
|
+ self.topic.forum.last_post_title = last_post.topic.title
|
|
-
|
|
+ self.topic.forum.last_post_user_id = last_post.user_id
|
|
|
|
+ self.topic.forum.last_post_username = last_post.username
|
|
|
|
+ self.topic.forum.last_post_created = last_post.date_created
|
|
|
|
+
|
|
|
|
+
|
|
if self.topic.second_last_post:
|
|
if self.topic.second_last_post:
|
|
|
|
|
|
self.topic.last_post_id = self.topic.second_last_post
|
|
self.topic.last_post_id = self.topic.second_last_post
|