From d2e0137c8d564852ee0960ca803824b417dcce9e Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Mon, 14 Nov 2022 17:14:47 +0000 Subject: [PATCH] Fix widgets in pages --- core/views/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/views/__init__.py b/core/views/__init__.py index a74bf25..fdc818b 100644 --- a/core/views/__init__.py +++ b/core/views/__init__.py @@ -54,6 +54,7 @@ class ObjectList(ObjectNameMixin, ListView): for arg in self.list_url_args: list_url_args[arg] = locals()[arg] + orig_type = type if type == "page": type = "modal" @@ -90,8 +91,10 @@ class ObjectList(ObjectNameMixin, ListView): # Return partials for HTMX if self.request.htmx: - # self.template_name = self.list_template - context["window_content"] = self.list_template + if orig_type == "page": + self.template_name = self.list_template + else: + context["window_content"] = self.list_template return self.render_to_response(context)