From b0435d0b7247c051ea2c6fe9e91f7b031bd84347 Mon Sep 17 00:00:00 2001 From: Matt Molyneaux Date: Tue, 13 Jun 2017 12:36:39 +0100 Subject: [PATCH] Flatten context for render_to_string This is now required for Django 1.11 --- watson/templatetags/watson.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/watson/templatetags/watson.py b/watson/templatetags/watson.py index ea30c06..8d0841a 100644 --- a/watson/templatetags/watson.py +++ b/watson/templatetags/watson.py @@ -19,7 +19,7 @@ def search_results(context, search_results): "search_results": search_results, "query": context["query"], }) - return template.loader.render_to_string("watson/includes/search_results.html", context) + return template.loader.render_to_string("watson/includes/search_results.html", context.flatten()) finally: context.pop() @@ -45,6 +45,6 @@ def search_result_item(context, search_result): "watson/includes/search_result_{app_label}_{model_name}.html".format(**params), "watson/includes/search_result_{app_label}.html".format(**params), "watson/includes/search_result_item.html", - ), context) + ), context.flatten()) finally: context.pop()