Browse Source

User posts by newest to oldest

This will allow users posts in their profile view to be listed from newest to oldest just like topics.
javaj0hn 8 years ago
parent
commit
6498f6418b
1 changed files with 2 additions and 0 deletions
  1. 2 0
      flaskbb/user/models.py

+ 2 - 0
flaskbb/user/models.py

@@ -275,6 +275,8 @@ class User(db.Model, UserMixin, CRUDMixin):
         """Returns a paginated result with all posts the user has created."""
 
         return Post.query.filter(Post.user_id == self.id).\
+            filter(Post.id == Post.id).\
+            order_by(Post.id.desc()).\
             paginate(page, flaskbb_config['TOPICS_PER_PAGE'], False)
 
     def track_topic(self, topic):