Commits

Sergey Maranchuk  committed 791457f

fix error in search page

  • Participants
  • Parent commits 0e5adf0

Comments (0)

Files changed (1)

File djangobb_forum/views.py

             _generic_context = False
         else:
             #searching more than forum_settings.SEARCH_PAGE_SIZE in this way - not good idea :]
-            topics = [topic for topic in topics[:forum_settings.SEARCH_PAGE_SIZE] if forum_extras.has_unreads(topic, user)]
+            topics_id = [topic.id for topic in topics[:forum_settings.SEARCH_PAGE_SIZE] if forum_extras.has_unreads(topic, user)]
+            topics = Topic.objects.filter(id__in=topics_id) # to create QuerySet
+
     elif action == 'show_unanswered':
         topics = topics.filter(post_count=1)
     elif action == 'show_subscriptions':