Browse Source

Fixed unread/read topics

sh4nks 11 years ago
parent
commit
1ee46928dd
1 changed files with 2 additions and 3 deletions
  1. 2 3
      flaskbb/utils/helpers.py

+ 2 - 3
flaskbb/utils/helpers.py

@@ -129,13 +129,12 @@ def topic_is_unread(topic, topicsread, user, forumsread=None):
     if topic and not topicsread and topic.last_post.date_created > read_cutoff:
 
         # user has cleared the forum sometime ago - check if there is a new post
-        if forumsread and forumsread.cleared > topic.last_post.date_created:
-            return False
+        if forumsread and forumsread.cleared is not None:
+            return forumsread.cleared < topic.last_post.date_created
 
         # user hasn't read the topic yet, or it has been cleared
         return True
 
-    current_app.logger.debug("User has read it. check if there is a new post")
     return topicsread.last_read < topic.last_post.date_created