Bugfix if anonymous user request "search/?action=show_new" See also: http://support.djangobb.org/topic/345/?page=1#post-1396
---
This commit is contained in:
parent
28694bd992
commit
e48dfed509
1 changed files with 4 additions and 1 deletions
|
@ -151,8 +151,11 @@ def search(request):
|
|||
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
|
||||
|
||||
|
|
Reference in a new issue