diff gpp/forums/unread.py @ 407:42a4e66972d5

Trying to fix #200; found a bug in the get_forum_unread_status() function. Added some db indexes.
author Brian Neal <bgneal@gmail.com>
date Fri, 01 Apr 2011 01:18:44 +0000
parents e9a066db3f54
children 7e0997b08b50
line wrap: on
line diff
--- a/gpp/forums/unread.py	Thu Mar 31 00:38:02 2011 +0000
+++ b/gpp/forums/unread.py	Fri Apr 01 01:18:44 2011 +0000
@@ -101,15 +101,15 @@
                 if topic.id in tracked_dict:
                     if topic.update_date > tracked_dict[topic.id].last_visit:
                         forum.has_unread = True
-                        continue
+                        break
                 else:
                     forum.has_unread = True
-                    continue
-
-            # If we made it through the above loop without continuing, then
-            # we are all caught up.
-            forum.catchup(user, flv)
-            forum.has_unread = False
+                    break
+            else:
+                # If we made it through the above loop without breaking out,
+                # then we are all caught up.
+                forum.catchup(user, flv)
+                forum.has_unread = False
 
 #######################################################################