mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2024-11-25 09:23:39 +01:00
Fix display of saved queries for authenticated users when CONTEXT_PROCESORS didn't include request.
This commit is contained in:
parent
2b225d6843
commit
fd9881e6e0
@ -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_ %}
|
||||
<!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">
|
||||
<head>
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user