sh4nks 11 лет назад
Родитель
Сommit
1ee46928dd
1 измененных файлов с 2 добавлено и 3 удалено
  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:
     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
         # 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
         # user hasn't read the topic yet, or it has been cleared
         return True
         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
     return topicsread.last_read < topic.last_post.date_created