1. sedah
  2. DjangoBB

Commits

Edward "Hades" Toroshchin  committed d8985db

Fix 500 error in search() when action=show_new

This is caused by the following line in views.py:173:

topics = [topic for topic in topics[:forum_settings.SEARCH_PAGE_SIZE] if forum_extras.has_unreads(topic, user)]

which replaces the QuerySet object with a plain Python list.

  • Participants
  • Parent commits 0e5adf0
  • Branches default

Comments (0)

Files changed (1)

File djangobb_forum/views.py

View file
         messages.success(request, _("Found %i posts.") % post_count)
     else:
         context["as_post_url"] = base_url + "posts"
-        topic_count = context["topics"].count()
+        if isinstance(context["topics"], list):
+            topic_count = len(context["topics"])
+        else:
+            topic_count = context["topics"].count()
         messages.success(request, _("Found %i topics.") % topic_count)
 
     return render(request, template_name, context)