search: use RequestContext in search results hits rendering (#32192)

This commit is contained in:
Serghei Mihai 2019-04-11 14:29:04 +02:00 committed by Frédéric Péters
parent 16ba59fcac
commit a38bcdc803
1 changed files with 2 additions and 2 deletions

View File

@ -23,7 +23,7 @@ from django.http import HttpResponse
from django.core.exceptions import PermissionDenied
from django.core.urlresolvers import reverse
from django.utils.http import quote
from django.template import Context, Template
from django.template import RequestContext, Template
from jsonfield import JSONField
from haystack import connections
@ -168,7 +168,7 @@ class SearchCell(CellBase):
if hit_templates:
for hit in results.get('data') or []:
for k, v in hit_templates.items():
hit[k] = v.render(Context(hit))
hit[k] = v.render(RequestContext(request, hit))
return render_response(service, results)
def has_text_search_service(self):