From a1445bceaea26772e2bf68c4d0df010dcfdf23f5 Mon Sep 17 00:00:00 2001 From: Gavin Elie Date: Tue, 20 Feb 2024 15:00:15 +0200 Subject: [PATCH] Update middleware.py Changed response.context to response.context_data (lines 19 and 21). --- django_htmx_refresh/middleware.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django_htmx_refresh/middleware.py b/django_htmx_refresh/middleware.py index 1ed3b84..fd10008 100644 --- a/django_htmx_refresh/middleware.py +++ b/django_htmx_refresh/middleware.py @@ -16,8 +16,8 @@ def process_template_response(self, request, response): if app_name in settings.HTMX_APPS: response.template_name = f"{app_name}/{response.template_name[0]}" if request.htmx: - response.context["base_template"] = "partial.html" + response.context_data["base_template"] = "partial.html" else: - response.context["base_template"] = "base.html" + response.context_data["base_template"] = "base.html" return response