From fd9881e6e05699ea1ea68fc1820c03cc6d962ad1 Mon Sep 17 00:00:00 2001 From: Ross Poulton Date: Wed, 29 Jan 2014 22:48:54 +1100 Subject: [PATCH] Fix display of saved queries for authenticated users when CONTEXT_PROCESORS didn't include request. --- helpdesk/templates/helpdesk/base.html | 2 +- helpdesk/templatetags/saved_queries.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/helpdesk/templates/helpdesk/base.html b/helpdesk/templates/helpdesk/base.html index 6924d6ee..6189240e 100644 --- a/helpdesk/templates/helpdesk/base.html +++ b/helpdesk/templates/helpdesk/base.html @@ -3,7 +3,7 @@ {% load saved_queries %} {% load load_helpdesk_settings %} {% with request|load_helpdesk_settings as helpdesk_settings %} -{% with request|saved_queries as user_saved_queries_ %} +{% with user|saved_queries as user_saved_queries_ %} diff --git a/helpdesk/templatetags/saved_queries.py b/helpdesk/templatetags/saved_queries.py index 8004a6f3..2a742623 100644 --- a/helpdesk/templatetags/saved_queries.py +++ b/helpdesk/templatetags/saved_queries.py @@ -11,9 +11,9 @@ from django.db.models import Q from helpdesk.models import SavedSearch -def saved_queries(request): +def saved_queries(user): try: - user_saved_queries = SavedSearch.objects.filter(Q(user=request.user) | Q(shared__exact=True)) + user_saved_queries = SavedSearch.objects.filter(Q(user=user) | Q(shared__exact=True)) return user_saved_queries except Exception, e: import sys