Просмотр исходного кода

Don't jam readtracker

Readtracker would jam when first thread on forum that user has read was
multipage.
Rafał Pitoń 10 лет назад
Родитель
Сommit
08645cb406
2 измененных файлов с 5 добавлено и 1 удалено
  1. 4 0
      misago/readtracker/forumstracker.py
  2. 1 1
      misago/readtracker/threadstracker.py

+ 4 - 0
misago/readtracker/forumstracker.py

@@ -40,6 +40,10 @@ def make_read(forums):
         forum.is_read = True
 
 
+def start_record(user, forum):
+    user.forumread_set.create(forum=forum, last_read_on=user.reads_cutoff)
+
+
 def sync_record(user, forum):
     cutoff_date = user.reads_cutoff
 

+ 1 - 1
misago/readtracker/threadstracker.py

@@ -130,7 +130,7 @@ def make_thread_read_aware(user, thread):
                 thread.is_read = True
                 thread.is_new = False
         except ForumRead.DoesNotExist:
-            pass
+            forumstracker.start_record(user, thread.forum)
 
 
 def make_posts_read_aware(user, thread, posts):