Commits

Jens Diemer committed 06033bd

Bugfix if anonymous user request "search/?action=show_new" See also: http://support.djangobb.org/topic/345/?page=1#post-1396
---

Comments (0)

Files changed (1)

djangobb_forum/views.py

             context["topics"] = topics.filter(Q(last_post__created__gte=date) | Q(last_post__updated__gte=date))
         _generic_context = False
     elif action == 'show_new':
+        user = request.user
+        if not user.is_authenticated():
+            raise Http404("Search 'show_new' not available for anonymous user.")
         try:
-            last_read = PostTracking.objects.get(user=request.user).last_read
+            last_read = PostTracking.objects.get(user=user).last_read
         except PostTracking.DoesNotExist:
             last_read = None