Browse Source

Fix issue where a hidden topic might be listed as most recent

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

+ 2 - 1
flaskbb/forum/models.py

@@ -691,7 +691,8 @@ class Topic(HideableCRUDMixin, db.Model):
     def _remove_topic_from_forum(self):
         # Grab the second last topic in the forum + parents/childs
         topics = Topic.query.filter(
-            Topic.forum_id == self.forum_id
+            Topic.forum_id == self.forum_id,
+            Topic.hidden != True
         ).order_by(
             Topic.last_post_id.desc()
         ).limit(2).offset(0).all()