Skip to content

Commit

Permalink
Fix htmx
Browse files Browse the repository at this point in the history
  • Loading branch information
davegaeddert committed Jan 21, 2024
1 parent 658b748 commit 483c090
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions bolt-htmx/bolt/htmx/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@
class HTMXViewMixin:
htmx_template_name = ""

def get_template(self):
def render_template(self):
template = super().get_template()
context = self.get_context()

if self.is_htmx_request and self.htmx_fragment_name:
from .jinja import HTMXFragmentExtension

template = super().get_template()
return HTMXFragmentExtension.render_template_fragment(
template=template,
template=template._jinja_template,
fragment_name=self.htmx_fragment_name,
context=context,
)

return super().get_template()
return template.render(context)

def get_request_handler(self):
if self.is_htmx_request:
Expand Down

0 comments on commit 483c090

Please sign in to comment.