Fix display of saved queries for authenticated users when CONTEXT_PROCESORS didn't include request.

This commit is contained in:
Ross Poulton 2014-01-29 22:48:54 +11:00
parent 2b225d6843
commit fd9881e6e0
2 changed files with 3 additions and 3 deletions

View File

@ -3,7 +3,7 @@
{% load saved_queries %} {% load saved_queries %}
{% load load_helpdesk_settings %} {% load load_helpdesk_settings %}
{% with request|load_helpdesk_settings as 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_ %}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>

View File

@ -11,9 +11,9 @@ from django.db.models import Q
from helpdesk.models import SavedSearch from helpdesk.models import SavedSearch
def saved_queries(request): def saved_queries(user):
try: 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 return user_saved_queries
except Exception, e: except Exception, e:
import sys import sys